Adapt to changes of Chrome 51 API changes (Part 2)
This commit is contained in:
		
					parent
					
						
							
								7ba391da7c
							
						
					
				
			
			
				commit
				
					
						a2bd55dd3c
					
				
			
		
					 48 changed files with 131 additions and 131 deletions
				
			
		| 
						 | 
					@ -190,7 +190,7 @@ class ResolveProxyHelper {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Start the request.
 | 
					    // Start the request.
 | 
				
			||||||
    int result = proxy_service->ResolveProxy(
 | 
					    int result = proxy_service->ResolveProxy(
 | 
				
			||||||
        url, net::LOAD_NORMAL, &proxy_info_, completion_callback,
 | 
					        url, "GET", net::LOAD_NORMAL, &proxy_info_, completion_callback,
 | 
				
			||||||
        &pac_req_, nullptr, net::BoundNetLog());
 | 
					        &pac_req_, nullptr, net::BoundNetLog());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Completed synchronously.
 | 
					    // Completed synchronously.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -261,7 +261,8 @@ WebContents::WebContents(v8::Isolate* isolate,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  content::WebContents* web_contents;
 | 
					  content::WebContents* web_contents;
 | 
				
			||||||
  if (is_guest) {
 | 
					  if (is_guest) {
 | 
				
			||||||
    content::SiteInstance* site_instance = content::SiteInstance::CreateForURL(
 | 
					    scoped_refptr<content::SiteInstance> site_instance =
 | 
				
			||||||
 | 
					        content::SiteInstance::CreateForURL(
 | 
				
			||||||
            session->browser_context(), GURL("chrome-guest://fake-host"));
 | 
					            session->browser_context(), GURL("chrome-guest://fake-host"));
 | 
				
			||||||
    content::WebContents::CreateParams params(
 | 
					    content::WebContents::CreateParams params(
 | 
				
			||||||
        session->browser_context(), site_instance);
 | 
					        session->browser_context(), site_instance);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -129,7 +129,8 @@ void AtomBrowserClient::OverrideSiteInstanceForNavigation(
 | 
				
			||||||
  if (url.SchemeIs(url::kJavaScriptScheme))
 | 
					  if (url.SchemeIs(url::kJavaScriptScheme))
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  *new_instance = content::SiteInstance::CreateForURL(browser_context, url);
 | 
					  *new_instance =
 | 
				
			||||||
 | 
					      content::SiteInstance::CreateForURL(browser_context, url).get();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Remember the original renderer process of the pending renderer process.
 | 
					  // Remember the original renderer process of the pending renderer process.
 | 
				
			||||||
  auto current_process = current_instance->GetProcess();
 | 
					  auto current_process = current_instance->GetProcess();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -26,7 +26,7 @@ void AtomJavaScriptDialogManager::RunBeforeUnloadDialog(
 | 
				
			||||||
    bool is_reload,
 | 
					    bool is_reload,
 | 
				
			||||||
    const DialogClosedCallback& callback) {
 | 
					    const DialogClosedCallback& callback) {
 | 
				
			||||||
  // FIXME(zcbenz): the |message_text| is removed, figure out what should we do.
 | 
					  // FIXME(zcbenz): the |message_text| is removed, figure out what should we do.
 | 
				
			||||||
  callback.Run(true);
 | 
					  callback.Run(true, base::ASCIIToUTF16("FIXME"));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}  // namespace atom
 | 
					}  // namespace atom
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -37,10 +37,11 @@ LoginHandler::LoginHandler(net::AuthChallengeInfo* auth_info,
 | 
				
			||||||
      render_frame_id_(0) {
 | 
					      render_frame_id_(0) {
 | 
				
			||||||
  content::ResourceRequestInfo::ForRequest(request_)->GetAssociatedRenderFrame(
 | 
					  content::ResourceRequestInfo::ForRequest(request_)->GetAssociatedRenderFrame(
 | 
				
			||||||
      &render_process_host_id_,  &render_frame_id_);
 | 
					      &render_process_host_id_,  &render_frame_id_);
 | 
				
			||||||
  BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
 | 
					  BrowserThread::PostTask(
 | 
				
			||||||
 | 
					      BrowserThread::UI, FROM_HERE,
 | 
				
			||||||
      base::Bind(&Browser::RequestLogin,
 | 
					      base::Bind(&Browser::RequestLogin,
 | 
				
			||||||
                 base::Unretained(Browser::Get()),
 | 
					                 base::Unretained(Browser::Get()),
 | 
				
			||||||
                                     make_scoped_refptr(this)));
 | 
					                 base::RetainedRef(make_scoped_refptr(this))));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LoginHandler::~LoginHandler() {
 | 
					LoginHandler::~LoginHandler() {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,8 +34,8 @@ void OnPointerLockResponse(content::WebContents* web_contents, bool allowed) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void OnPermissionResponse(const base::Callback<void(bool)>& callback,
 | 
					void OnPermissionResponse(const base::Callback<void(bool)>& callback,
 | 
				
			||||||
                          content::PermissionStatus status) {
 | 
					                          blink::mojom::PermissionStatus status) {
 | 
				
			||||||
  if (status == content::PermissionStatus::GRANTED)
 | 
					  if (status == blink::mojom::PermissionStatus::GRANTED)
 | 
				
			||||||
    callback.Run(true);
 | 
					    callback.Run(true);
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    callback.Run(false);
 | 
					    callback.Run(false);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,6 @@
 | 
				
			||||||
#include "atom/common/api/locker.h"
 | 
					#include "atom/common/api/locker.h"
 | 
				
			||||||
#include "atom/common/node_includes.h"
 | 
					#include "atom/common/node_includes.h"
 | 
				
			||||||
#include "base/memory/scoped_ptr.h"
 | 
					#include "base/memory/scoped_ptr.h"
 | 
				
			||||||
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace mate {
 | 
					namespace mate {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,9 +16,11 @@ v8::Local<v8::Value> CallEmitWithArgs(v8::Isolate* isolate,
 | 
				
			||||||
                                      v8::Local<v8::Object> obj,
 | 
					                                      v8::Local<v8::Object> obj,
 | 
				
			||||||
                                      ValueVector* args) {
 | 
					                                      ValueVector* args) {
 | 
				
			||||||
  // Perform microtask checkpoint after running JavaScript.
 | 
					  // Perform microtask checkpoint after running JavaScript.
 | 
				
			||||||
  std::unique_ptr<blink::WebScopedRunV8Script> script_scope(
 | 
					  std::unique_ptr<v8::MicrotasksScope> script_scope(
 | 
				
			||||||
      Locker::IsBrowserProcess() ?
 | 
					      Locker::IsBrowserProcess() ?
 | 
				
			||||||
      nullptr : new blink::WebScopedRunV8Script);
 | 
					          nullptr :
 | 
				
			||||||
 | 
					          new v8::MicrotasksScope(isolate,
 | 
				
			||||||
 | 
					                                  v8::MicrotasksScope::kRunMicrotasks));
 | 
				
			||||||
  // Use node::MakeCallback to call the callback, and it will also run pending
 | 
					  // Use node::MakeCallback to call the callback, and it will also run pending
 | 
				
			||||||
  // tasks in Node.js.
 | 
					  // tasks in Node.js.
 | 
				
			||||||
  return node::MakeCallback(
 | 
					  return node::MakeCallback(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -21,7 +21,6 @@
 | 
				
			||||||
#include "content/public/browser/browser_thread.h"
 | 
					#include "content/public/browser/browser_thread.h"
 | 
				
			||||||
#include "content/public/common/content_paths.h"
 | 
					#include "content/public/common/content_paths.h"
 | 
				
			||||||
#include "native_mate/dictionary.h"
 | 
					#include "native_mate/dictionary.h"
 | 
				
			||||||
#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
using content::BrowserThread;
 | 
					using content::BrowserThread;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -226,8 +225,10 @@ void NodeBindings::UvRunOnce() {
 | 
				
			||||||
  v8::Context::Scope context_scope(env->context());
 | 
					  v8::Context::Scope context_scope(env->context());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Perform microtask checkpoint after running JavaScript.
 | 
					  // Perform microtask checkpoint after running JavaScript.
 | 
				
			||||||
  std::unique_ptr<blink::WebScopedRunV8Script> script_scope(
 | 
					  std::unique_ptr<v8::MicrotasksScope> script_scope(is_browser_ ?
 | 
				
			||||||
      is_browser_ ? nullptr : new blink::WebScopedRunV8Script);
 | 
					      nullptr :
 | 
				
			||||||
 | 
					      new v8::MicrotasksScope(env->isolate(),
 | 
				
			||||||
 | 
					                              v8::MicrotasksScope::kRunMicrotasks));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Deal with uv events.
 | 
					  // Deal with uv events.
 | 
				
			||||||
  int r = uv_run(uv_loop_, UV_RUN_NOWAIT);
 | 
					  int r = uv_run(uv_loop_, UV_RUN_NOWAIT);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,7 +31,7 @@ class BrowserProcess {
 | 
				
			||||||
  printing::PrintJobManager* print_job_manager();
 | 
					  printing::PrintJobManager* print_job_manager();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  scoped_ptr<printing::PrintJobManager> print_job_manager_;
 | 
					  std::unique_ptr<printing::PrintJobManager> print_job_manager_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DISALLOW_COPY_AND_ASSIGN(BrowserProcess);
 | 
					  DISALLOW_COPY_AND_ASSIGN(BrowserProcess);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -138,7 +138,7 @@ void CertificateManagerModel::DidGetCertDBOnUIThread(
 | 
				
			||||||
    const CreationCallback& callback) {
 | 
					    const CreationCallback& callback) {
 | 
				
			||||||
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
 | 
					  DCHECK_CURRENTLY_ON(BrowserThread::UI);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<CertificateManagerModel> model(new CertificateManagerModel(
 | 
					  std::unique_ptr<CertificateManagerModel> model(new CertificateManagerModel(
 | 
				
			||||||
      cert_db, is_user_db_available));
 | 
					      cert_db, is_user_db_available));
 | 
				
			||||||
  callback.Run(std::move(model));
 | 
					  callback.Run(std::move(model));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@ class ResourceContext;
 | 
				
			||||||
// manager dialog, and processes changes from the view.
 | 
					// manager dialog, and processes changes from the view.
 | 
				
			||||||
class CertificateManagerModel {
 | 
					class CertificateManagerModel {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
  typedef base::Callback<void(scoped_ptr<CertificateManagerModel>)>
 | 
					  typedef base::Callback<void(std::unique_ptr<CertificateManagerModel>)>
 | 
				
			||||||
      CreationCallback;
 | 
					      CreationCallback;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Creates a CertificateManagerModel. The model will be passed to the callback
 | 
					  // Creates a CertificateManagerModel. The model will be passed to the callback
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,7 +41,7 @@ class GlobalShortcutListenerWin : public GlobalShortcutListener {
 | 
				
			||||||
  typedef std::map<ui::Accelerator, int> HotkeyIdMap;
 | 
					  typedef std::map<ui::Accelerator, int> HotkeyIdMap;
 | 
				
			||||||
  HotkeyIdMap hotkey_ids_;
 | 
					  HotkeyIdMap hotkey_ids_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<gfx::SingletonHwndObserver> singleton_hwnd_observer_;
 | 
					  std::unique_ptr<gfx::SingletonHwndObserver> singleton_hwnd_observer_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerWin);
 | 
					  DISALLOW_COPY_AND_ASSIGN(GlobalShortcutListenerWin);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,7 @@ uint32_t GetFrameHash(webrtc::DesktopFrame* frame) {
 | 
				
			||||||
  return base::SuperFastHash(reinterpret_cast<char*>(frame->data()), data_size);
 | 
					  return base::SuperFastHash(reinterpret_cast<char*>(frame->data()), data_size);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
gfx::ImageSkia ScaleDesktopFrame(scoped_ptr<webrtc::DesktopFrame> frame,
 | 
					gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
 | 
				
			||||||
                                 gfx::Size size) {
 | 
					                                 gfx::Size size) {
 | 
				
			||||||
  gfx::Rect scaled_rect = media::ComputeLetterboxRegion(
 | 
					  gfx::Rect scaled_rect = media::ComputeLetterboxRegion(
 | 
				
			||||||
      gfx::Rect(0, 0, size.width(), size.height()),
 | 
					      gfx::Rect(0, 0, size.width(), size.height()),
 | 
				
			||||||
| 
						 | 
					@ -86,8 +86,8 @@ class NativeDesktopMediaList::Worker
 | 
				
			||||||
    : public webrtc::DesktopCapturer::Callback {
 | 
					    : public webrtc::DesktopCapturer::Callback {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
  Worker(base::WeakPtr<NativeDesktopMediaList> media_list,
 | 
					  Worker(base::WeakPtr<NativeDesktopMediaList> media_list,
 | 
				
			||||||
         scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
					         std::unique_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
				
			||||||
         scoped_ptr<webrtc::WindowCapturer> window_capturer);
 | 
					         std::unique_ptr<webrtc::WindowCapturer> window_capturer);
 | 
				
			||||||
  ~Worker() override;
 | 
					  ~Worker() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  void Refresh(const gfx::Size& thumbnail_size,
 | 
					  void Refresh(const gfx::Size& thumbnail_size,
 | 
				
			||||||
| 
						 | 
					@ -102,10 +102,10 @@ class NativeDesktopMediaList::Worker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  base::WeakPtr<NativeDesktopMediaList> media_list_;
 | 
					  base::WeakPtr<NativeDesktopMediaList> media_list_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<webrtc::ScreenCapturer> screen_capturer_;
 | 
					  std::unique_ptr<webrtc::ScreenCapturer> screen_capturer_;
 | 
				
			||||||
  scoped_ptr<webrtc::WindowCapturer> window_capturer_;
 | 
					  std::unique_ptr<webrtc::WindowCapturer> window_capturer_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<webrtc::DesktopFrame> current_frame_;
 | 
					  std::unique_ptr<webrtc::DesktopFrame> current_frame_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ImageHashesMap image_hashes_;
 | 
					  ImageHashesMap image_hashes_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -114,8 +114,8 @@ class NativeDesktopMediaList::Worker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NativeDesktopMediaList::Worker::Worker(
 | 
					NativeDesktopMediaList::Worker::Worker(
 | 
				
			||||||
    base::WeakPtr<NativeDesktopMediaList> media_list,
 | 
					    base::WeakPtr<NativeDesktopMediaList> media_list,
 | 
				
			||||||
    scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
					    std::unique_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
				
			||||||
    scoped_ptr<webrtc::WindowCapturer> window_capturer)
 | 
					    std::unique_ptr<webrtc::WindowCapturer> window_capturer)
 | 
				
			||||||
    : media_list_(media_list),
 | 
					    : media_list_(media_list),
 | 
				
			||||||
      screen_capturer_(std::move(screen_capturer)),
 | 
					      screen_capturer_(std::move(screen_capturer)),
 | 
				
			||||||
      window_capturer_(std::move(window_capturer)) {
 | 
					      window_capturer_(std::move(window_capturer)) {
 | 
				
			||||||
| 
						 | 
					@ -229,8 +229,8 @@ void NativeDesktopMediaList::Worker::OnCaptureCompleted(
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
NativeDesktopMediaList::NativeDesktopMediaList(
 | 
					NativeDesktopMediaList::NativeDesktopMediaList(
 | 
				
			||||||
    scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
					    std::unique_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
				
			||||||
    scoped_ptr<webrtc::WindowCapturer> window_capturer)
 | 
					    std::unique_ptr<webrtc::WindowCapturer> window_capturer)
 | 
				
			||||||
    : screen_capturer_(std::move(screen_capturer)),
 | 
					    : screen_capturer_(std::move(screen_capturer)),
 | 
				
			||||||
      window_capturer_(std::move(window_capturer)),
 | 
					      window_capturer_(std::move(window_capturer)),
 | 
				
			||||||
      update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)),
 | 
					      update_period_(base::TimeDelta::FromMilliseconds(kDefaultUpdatePeriod)),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,8 +25,8 @@ class NativeDesktopMediaList : public DesktopMediaList {
 | 
				
			||||||
  // types of sources the model should be populated with (e.g. it will only
 | 
					  // types of sources the model should be populated with (e.g. it will only
 | 
				
			||||||
  // contain windows, if |screen_capturer| is NULL).
 | 
					  // contain windows, if |screen_capturer| is NULL).
 | 
				
			||||||
  NativeDesktopMediaList(
 | 
					  NativeDesktopMediaList(
 | 
				
			||||||
      scoped_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
					      std::unique_ptr<webrtc::ScreenCapturer> screen_capturer,
 | 
				
			||||||
      scoped_ptr<webrtc::WindowCapturer> window_capturer);
 | 
					      std::unique_ptr<webrtc::WindowCapturer> window_capturer);
 | 
				
			||||||
  ~NativeDesktopMediaList() override;
 | 
					  ~NativeDesktopMediaList() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // DesktopMediaList interface.
 | 
					  // DesktopMediaList interface.
 | 
				
			||||||
| 
						 | 
					@ -66,8 +66,8 @@ class NativeDesktopMediaList : public DesktopMediaList {
 | 
				
			||||||
  void OnRefreshFinished();
 | 
					  void OnRefreshFinished();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Capturers specified in SetCapturers() and passed to the |worker_| later.
 | 
					  // Capturers specified in SetCapturers() and passed to the |worker_| later.
 | 
				
			||||||
  scoped_ptr<webrtc::ScreenCapturer> screen_capturer_;
 | 
					  std::unique_ptr<webrtc::ScreenCapturer> screen_capturer_;
 | 
				
			||||||
  scoped_ptr<webrtc::WindowCapturer> window_capturer_;
 | 
					  std::unique_ptr<webrtc::WindowCapturer> window_capturer_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Time interval between mode updates.
 | 
					  // Time interval between mode updates.
 | 
				
			||||||
  base::TimeDelta update_period_;
 | 
					  base::TimeDelta update_period_;
 | 
				
			||||||
| 
						 | 
					@ -87,7 +87,7 @@ class NativeDesktopMediaList : public DesktopMediaList {
 | 
				
			||||||
  // An object that does all the work of getting list of sources on a background
 | 
					  // An object that does all the work of getting list of sources on a background
 | 
				
			||||||
  // thread (see |capture_task_runner_|). Destroyed on |capture_task_runner_|
 | 
					  // thread (see |capture_task_runner_|). Destroyed on |capture_task_runner_|
 | 
				
			||||||
  // after the model is destroyed.
 | 
					  // after the model is destroyed.
 | 
				
			||||||
  scoped_ptr<Worker> worker_;
 | 
					  std::unique_ptr<Worker> worker_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Current list of sources.
 | 
					  // Current list of sources.
 | 
				
			||||||
  std::vector<Source> sources_;
 | 
					  std::vector<Source> sources_;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,7 +48,7 @@ class RefCountedTempDir
 | 
				
			||||||
  DISALLOW_COPY_AND_ASSIGN(RefCountedTempDir);
 | 
					  DISALLOW_COPY_AND_ASSIGN(RefCountedTempDir);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
typedef scoped_ptr<base::File, BrowserThread::DeleteOnFileThread>
 | 
					typedef std::unique_ptr<base::File, BrowserThread::DeleteOnFileThread>
 | 
				
			||||||
    ScopedTempFile;
 | 
					    ScopedTempFile;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Wrapper for Emf to keep only file handle in memory, and load actual data only
 | 
					// Wrapper for Emf to keep only file handle in memory, and load actual data only
 | 
				
			||||||
| 
						 | 
					@ -389,7 +389,7 @@ void PdfToEmfUtilityProcessHostClient::OnPageDone(bool success,
 | 
				
			||||||
  DCHECK_CURRENTLY_ON(BrowserThread::IO);
 | 
					  DCHECK_CURRENTLY_ON(BrowserThread::IO);
 | 
				
			||||||
  if (get_page_callbacks_.empty())
 | 
					  if (get_page_callbacks_.empty())
 | 
				
			||||||
    return OnFailed();
 | 
					    return OnFailed();
 | 
				
			||||||
  scoped_ptr<MetafilePlayer> emf;
 | 
					  std::unique_ptr<MetafilePlayer> emf;
 | 
				
			||||||
  GetPageCallbackData& data = get_page_callbacks_.front();
 | 
					  GetPageCallbackData& data = get_page_callbacks_.front();
 | 
				
			||||||
  if (success)
 | 
					  if (success)
 | 
				
			||||||
    emf.reset(new LazyEmf(temp_dir_, data.emf().Pass()));
 | 
					    emf.reset(new LazyEmf(temp_dir_, data.emf().Pass()));
 | 
				
			||||||
| 
						 | 
					@ -487,8 +487,8 @@ PdfToEmfConverter::~PdfToEmfConverter() {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// static
 | 
					// static
 | 
				
			||||||
scoped_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() {
 | 
					std::unique_ptr<PdfToEmfConverter> PdfToEmfConverter::CreateDefault() {
 | 
				
			||||||
  return scoped_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl());
 | 
					  return std::unique_ptr<PdfToEmfConverter>(new PdfToEmfConverterImpl());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}  // namespace printing
 | 
					}  // namespace printing
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,11 +23,11 @@ class PdfToEmfConverter {
 | 
				
			||||||
  typedef base::Callback<void(int page_count)> StartCallback;
 | 
					  typedef base::Callback<void(int page_count)> StartCallback;
 | 
				
			||||||
  typedef base::Callback<void(int page_number,
 | 
					  typedef base::Callback<void(int page_number,
 | 
				
			||||||
                              float scale_factor,
 | 
					                              float scale_factor,
 | 
				
			||||||
                              scoped_ptr<MetafilePlayer> emf)> GetPageCallback;
 | 
					                              std::unique_ptr<MetafilePlayer> emf)> GetPageCallback;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  virtual ~PdfToEmfConverter();
 | 
					  virtual ~PdfToEmfConverter();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  static scoped_ptr<PdfToEmfConverter> CreateDefault();
 | 
					  static std::unique_ptr<PdfToEmfConverter> CreateDefault();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Starts conversion of PDF provided as |data|. Calls |start_callback|
 | 
					  // Starts conversion of PDF provided as |data|. Calls |start_callback|
 | 
				
			||||||
  // with positive |page_count|. |page_count| is 0 if initialization failed.
 | 
					  // with positive |page_count|. |page_count| is 0 if initialization failed.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -133,7 +133,7 @@ void PrintJob::StartPrinting() {
 | 
				
			||||||
                               make_scoped_refptr(this),
 | 
					                               make_scoped_refptr(this),
 | 
				
			||||||
                               base::Bind(&PrintJobWorker::StartPrinting,
 | 
					                               base::Bind(&PrintJobWorker::StartPrinting,
 | 
				
			||||||
                                          base::Unretained(worker_.get()),
 | 
					                                          base::Unretained(worker_.get()),
 | 
				
			||||||
                                          document_)));
 | 
					                                          base::RetainedRef(document_))));
 | 
				
			||||||
  // Set the flag right now.
 | 
					  // Set the flag right now.
 | 
				
			||||||
  is_job_pending_ = true;
 | 
					  is_job_pending_ = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -267,7 +267,7 @@ class PrintJob::PdfToEmfState {
 | 
				
			||||||
  int pages_in_progress_;
 | 
					  int pages_in_progress_;
 | 
				
			||||||
  gfx::Size page_size_;
 | 
					  gfx::Size page_size_;
 | 
				
			||||||
  gfx::Rect content_area_;
 | 
					  gfx::Rect content_area_;
 | 
				
			||||||
  scoped_ptr<PdfToEmfConverter> converter_;
 | 
					  std::unique_ptr<PdfToEmfConverter> converter_;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PrintJob::StartPdfToEmfConversion(
 | 
					void PrintJob::StartPdfToEmfConversion(
 | 
				
			||||||
| 
						 | 
					@ -296,7 +296,7 @@ void PrintJob::OnPdfToEmfStarted(int page_count) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PrintJob::OnPdfToEmfPageConverted(int page_number,
 | 
					void PrintJob::OnPdfToEmfPageConverted(int page_number,
 | 
				
			||||||
                                       float scale_factor,
 | 
					                                       float scale_factor,
 | 
				
			||||||
                                       scoped_ptr<MetafilePlayer> emf) {
 | 
					                                       std::unique_ptr<MetafilePlayer> emf) {
 | 
				
			||||||
  DCHECK(ptd_to_emf_state_);
 | 
					  DCHECK(ptd_to_emf_state_);
 | 
				
			||||||
  if (!document_.get() || !emf) {
 | 
					  if (!document_.get() || !emf) {
 | 
				
			||||||
    ptd_to_emf_state_.reset();
 | 
					    ptd_to_emf_state_.reset();
 | 
				
			||||||
| 
						 | 
					@ -335,7 +335,7 @@ void PrintJob::UpdatePrintedDocument(PrintedDocument* new_document) {
 | 
				
			||||||
                                 make_scoped_refptr(this),
 | 
					                                 make_scoped_refptr(this),
 | 
				
			||||||
                                 base::Bind(&PrintJobWorker::OnDocumentChanged,
 | 
					                                 base::Bind(&PrintJobWorker::OnDocumentChanged,
 | 
				
			||||||
                                            base::Unretained(worker_.get()),
 | 
					                                            base::Unretained(worker_.get()),
 | 
				
			||||||
                                            document_)));
 | 
					                                            base::RetainedRef(document_))));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -98,7 +98,7 @@ class PrintJob : public PrintJobWorkerOwner,
 | 
				
			||||||
  void OnPdfToEmfStarted(int page_count);
 | 
					  void OnPdfToEmfStarted(int page_count);
 | 
				
			||||||
  void OnPdfToEmfPageConverted(int page_number,
 | 
					  void OnPdfToEmfPageConverted(int page_number,
 | 
				
			||||||
                               float scale_factor,
 | 
					                               float scale_factor,
 | 
				
			||||||
                               scoped_ptr<MetafilePlayer> emf);
 | 
					                               std::unique_ptr<MetafilePlayer> emf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif  // OS_WIN
 | 
					#endif  // OS_WIN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -134,7 +134,7 @@ class PrintJob : public PrintJobWorkerOwner,
 | 
				
			||||||
  // All the UI is done in a worker thread because many Win32 print functions
 | 
					  // All the UI is done in a worker thread because many Win32 print functions
 | 
				
			||||||
  // are blocking and enters a message loop without your consent. There is one
 | 
					  // are blocking and enters a message loop without your consent. There is one
 | 
				
			||||||
  // worker thread per print job.
 | 
					  // worker thread per print job.
 | 
				
			||||||
  scoped_ptr<PrintJobWorker> worker_;
 | 
					  std::unique_ptr<PrintJobWorker> worker_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Cache of the print context settings for access in the UI thread.
 | 
					  // Cache of the print context settings for access in the UI thread.
 | 
				
			||||||
  PrintSettings settings_;
 | 
					  PrintSettings settings_;
 | 
				
			||||||
| 
						 | 
					@ -151,7 +151,7 @@ class PrintJob : public PrintJobWorkerOwner,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(OS_WIN)
 | 
					#if defined(OS_WIN)
 | 
				
			||||||
  class PdfToEmfState;
 | 
					  class PdfToEmfState;
 | 
				
			||||||
  scoped_ptr<PdfToEmfState> ptd_to_emf_state_;
 | 
					  std::unique_ptr<PdfToEmfState> ptd_to_emf_state_;
 | 
				
			||||||
#endif  // OS_WIN
 | 
					#endif  // OS_WIN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Used at shutdown so that we can quit a nested message loop.
 | 
					  // Used at shutdown so that we can quit a nested message loop.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -146,7 +146,7 @@ void PrintJobWorker::GetSettings(
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PrintJobWorker::SetSettings(
 | 
					void PrintJobWorker::SetSettings(
 | 
				
			||||||
    scoped_ptr<base::DictionaryValue> new_settings) {
 | 
					    std::unique_ptr<base::DictionaryValue> new_settings) {
 | 
				
			||||||
  DCHECK(task_runner_->RunsTasksOnCurrentThread());
 | 
					  DCHECK(task_runner_->RunsTasksOnCurrentThread());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  BrowserThread::PostTask(
 | 
					  BrowserThread::PostTask(
 | 
				
			||||||
| 
						 | 
					@ -160,7 +160,7 @@ void PrintJobWorker::SetSettings(
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PrintJobWorker::UpdatePrintSettings(
 | 
					void PrintJobWorker::UpdatePrintSettings(
 | 
				
			||||||
    scoped_ptr<base::DictionaryValue> new_settings) {
 | 
					    std::unique_ptr<base::DictionaryValue> new_settings) {
 | 
				
			||||||
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
 | 
					  DCHECK_CURRENTLY_ON(BrowserThread::UI);
 | 
				
			||||||
  PrintingContext::Result result =
 | 
					  PrintingContext::Result result =
 | 
				
			||||||
      printing_context_->UpdatePrintSettings(*new_settings);
 | 
					      printing_context_->UpdatePrintSettings(*new_settings);
 | 
				
			||||||
| 
						 | 
					@ -338,11 +338,9 @@ void PrintJobWorker::OnDocumentDone() {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  owner_->PostTask(FROM_HERE,
 | 
					  owner_->PostTask(FROM_HERE,
 | 
				
			||||||
                   base::Bind(&NotificationCallback,
 | 
					                   base::Bind(&NotificationCallback, base::RetainedRef(owner_),
 | 
				
			||||||
                              make_scoped_refptr(owner_),
 | 
					 | 
				
			||||||
                              JobEventDetails::DOC_DONE,
 | 
					                              JobEventDetails::DOC_DONE,
 | 
				
			||||||
                              document_,
 | 
					                              base::RetainedRef(document_), nullptr));
 | 
				
			||||||
                              scoped_refptr<PrintedPage>()));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Makes sure the variables are reinitialized.
 | 
					  // Makes sure the variables are reinitialized.
 | 
				
			||||||
  document_ = NULL;
 | 
					  document_ = NULL;
 | 
				
			||||||
| 
						 | 
					@ -354,11 +352,9 @@ void PrintJobWorker::SpoolPage(PrintedPage* page) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Signal everyone that the page is about to be printed.
 | 
					  // Signal everyone that the page is about to be printed.
 | 
				
			||||||
  owner_->PostTask(FROM_HERE,
 | 
					  owner_->PostTask(FROM_HERE,
 | 
				
			||||||
                   base::Bind(&NotificationCallback,
 | 
					                   base::Bind(&NotificationCallback, base::RetainedRef(owner_),
 | 
				
			||||||
                              make_scoped_refptr(owner_),
 | 
					                              JobEventDetails::NEW_PAGE, base::RetainedRef(document_),
 | 
				
			||||||
                              JobEventDetails::NEW_PAGE,
 | 
					                              base::RetainedRef(page)));
 | 
				
			||||||
                              document_,
 | 
					 | 
				
			||||||
                              make_scoped_refptr(page)));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Preprocess.
 | 
					  // Preprocess.
 | 
				
			||||||
  if (printing_context_->NewPage() != PrintingContext::OK) {
 | 
					  if (printing_context_->NewPage() != PrintingContext::OK) {
 | 
				
			||||||
| 
						 | 
					@ -380,12 +376,11 @@ void PrintJobWorker::SpoolPage(PrintedPage* page) {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Signal everyone that the page is printed.
 | 
					  // Signal everyone that the page is printed.
 | 
				
			||||||
  owner_->PostTask(FROM_HERE,
 | 
					  owner_->PostTask(
 | 
				
			||||||
                   base::Bind(&NotificationCallback,
 | 
					      FROM_HERE,
 | 
				
			||||||
                              make_scoped_refptr(owner_),
 | 
					      base::Bind(&NotificationCallback, base::RetainedRef(owner_),
 | 
				
			||||||
                              JobEventDetails::PAGE_DONE,
 | 
					                 JobEventDetails::PAGE_DONE, base::RetainedRef(document_),
 | 
				
			||||||
                              document_,
 | 
					                 base::RetainedRef(page)));
 | 
				
			||||||
                              make_scoped_refptr(page)));
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PrintJobWorker::OnFailure() {
 | 
					void PrintJobWorker::OnFailure() {
 | 
				
			||||||
| 
						 | 
					@ -394,12 +389,11 @@ void PrintJobWorker::OnFailure() {
 | 
				
			||||||
  // We may loose our last reference by broadcasting the FAILED event.
 | 
					  // We may loose our last reference by broadcasting the FAILED event.
 | 
				
			||||||
  scoped_refptr<PrintJobWorkerOwner> handle(owner_);
 | 
					  scoped_refptr<PrintJobWorkerOwner> handle(owner_);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  owner_->PostTask(FROM_HERE,
 | 
					  owner_->PostTask(
 | 
				
			||||||
                   base::Bind(&NotificationCallback,
 | 
					      FROM_HERE,
 | 
				
			||||||
                              make_scoped_refptr(owner_),
 | 
					      base::Bind(&NotificationCallback, base::RetainedRef(owner_),
 | 
				
			||||||
                 JobEventDetails::FAILED,
 | 
					                 JobEventDetails::FAILED,
 | 
				
			||||||
                              document_,
 | 
					                 base::RetainedRef(document_), nullptr));
 | 
				
			||||||
                              scoped_refptr<PrintedPage>()));
 | 
					 | 
				
			||||||
  Cancel();
 | 
					  Cancel();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Makes sure the variables are reinitialized.
 | 
					  // Makes sure the variables are reinitialized.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,7 +48,7 @@ class PrintJobWorker {
 | 
				
			||||||
      MarginType margin_type);
 | 
					      MarginType margin_type);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Set the new print settings.
 | 
					  // Set the new print settings.
 | 
				
			||||||
  void SetSettings(scoped_ptr<base::DictionaryValue> new_settings);
 | 
					  void SetSettings(std::unique_ptr<base::DictionaryValue> new_settings);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Starts the printing loop. Every pages are printed as soon as the data is
 | 
					  // Starts the printing loop. Every pages are printed as soon as the data is
 | 
				
			||||||
  // available. Makes sure the new_document is the right one.
 | 
					  // available. Makes sure the new_document is the right one.
 | 
				
			||||||
| 
						 | 
					@ -116,7 +116,7 @@ class PrintJobWorker {
 | 
				
			||||||
  void GetSettingsWithUIDone(PrintingContext::Result result);
 | 
					  void GetSettingsWithUIDone(PrintingContext::Result result);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Called on the UI thread to update the print settings.
 | 
					  // Called on the UI thread to update the print settings.
 | 
				
			||||||
  void UpdatePrintSettings(scoped_ptr<base::DictionaryValue> new_settings);
 | 
					  void UpdatePrintSettings(std::unique_ptr<base::DictionaryValue> new_settings);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Reports settings back to owner_.
 | 
					  // Reports settings back to owner_.
 | 
				
			||||||
  void GetSettingsDone(PrintingContext::Result result);
 | 
					  void GetSettingsDone(PrintingContext::Result result);
 | 
				
			||||||
| 
						 | 
					@ -127,10 +127,10 @@ class PrintJobWorker {
 | 
				
			||||||
  void UseDefaultSettings();
 | 
					  void UseDefaultSettings();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Printing context delegate.
 | 
					  // Printing context delegate.
 | 
				
			||||||
  scoped_ptr<PrintingContext::Delegate> printing_context_delegate_;
 | 
					  std::unique_ptr<PrintingContext::Delegate> printing_context_delegate_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Information about the printer setting.
 | 
					  // Information about the printer setting.
 | 
				
			||||||
  scoped_ptr<PrintingContext> printing_context_;
 | 
					  std::unique_ptr<PrintingContext> printing_context_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // The printed document. Only has read-only access.
 | 
					  // The printed document. Only has read-only access.
 | 
				
			||||||
  scoped_refptr<PrintedDocument> document_;
 | 
					  scoped_refptr<PrintedDocument> document_;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,7 @@ void StopWorker(int document_cookie) {
 | 
				
			||||||
char* CopyPDFDataOnIOThread(
 | 
					char* CopyPDFDataOnIOThread(
 | 
				
			||||||
    const PrintHostMsg_DidPreviewDocument_Params& params) {
 | 
					    const PrintHostMsg_DidPreviewDocument_Params& params) {
 | 
				
			||||||
  DCHECK_CURRENTLY_ON(BrowserThread::IO);
 | 
					  DCHECK_CURRENTLY_ON(BrowserThread::IO);
 | 
				
			||||||
  scoped_ptr<base::SharedMemory> shared_buf(
 | 
					  std::unique_ptr<base::SharedMemory> shared_buf(
 | 
				
			||||||
      new base::SharedMemory(params.metafile_data_handle, true));
 | 
					      new base::SharedMemory(params.metafile_data_handle, true));
 | 
				
			||||||
  if (!shared_buf->Map(params.data_size))
 | 
					  if (!shared_buf->Map(params.data_size))
 | 
				
			||||||
    return nullptr;
 | 
					    return nullptr;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,7 +132,7 @@ void PrintViewManagerBase::OnDidPrintPage(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia);
 | 
					  std::unique_ptr<PdfMetafileSkia> metafile(new PdfMetafileSkia);
 | 
				
			||||||
  if (metafile_must_be_valid) {
 | 
					  if (metafile_must_be_valid) {
 | 
				
			||||||
    if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) {
 | 
					    if (!metafile->InitFromData(shared_buf.memory(), params.data_size)) {
 | 
				
			||||||
      NOTREACHED() << "Invalid metafile header";
 | 
					      NOTREACHED() << "Invalid metafile header";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -85,7 +85,7 @@ void PrinterQuery::GetSettings(
 | 
				
			||||||
                               margin_type));
 | 
					                               margin_type));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PrinterQuery::SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
 | 
					void PrinterQuery::SetSettings(std::unique_ptr<base::DictionaryValue> new_settings,
 | 
				
			||||||
                               const base::Closure& callback) {
 | 
					                               const base::Closure& callback) {
 | 
				
			||||||
  StartWorker(callback);
 | 
					  StartWorker(callback);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -50,7 +50,7 @@ class PrinterQuery : public PrintJobWorkerOwner {
 | 
				
			||||||
      const base::Closure& callback);
 | 
					      const base::Closure& callback);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Updates the current settings with |new_settings| dictionary values.
 | 
					  // Updates the current settings with |new_settings| dictionary values.
 | 
				
			||||||
  void SetSettings(scoped_ptr<base::DictionaryValue> new_settings,
 | 
					  void SetSettings(std::unique_ptr<base::DictionaryValue> new_settings,
 | 
				
			||||||
                   const base::Closure& callback);
 | 
					                   const base::Closure& callback);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Stops the worker thread since the client is done with this object.
 | 
					  // Stops the worker thread since the client is done with this object.
 | 
				
			||||||
| 
						 | 
					@ -73,7 +73,7 @@ class PrinterQuery : public PrintJobWorkerOwner {
 | 
				
			||||||
  // All the UI is done in a worker thread because many Win32 print functions
 | 
					  // All the UI is done in a worker thread because many Win32 print functions
 | 
				
			||||||
  // are blocking and enters a message loop without your consent. There is one
 | 
					  // are blocking and enters a message loop without your consent. There is one
 | 
				
			||||||
  // worker thread per print job.
 | 
					  // worker thread per print job.
 | 
				
			||||||
  scoped_ptr<PrintJobWorker> worker_;
 | 
					  std::unique_ptr<PrintJobWorker> worker_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Cache of the print context settings for access in the UI thread.
 | 
					  // Cache of the print context settings for access in the UI thread.
 | 
				
			||||||
  PrintSettings settings_;
 | 
					  PrintSettings settings_;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -373,7 +373,7 @@ void PrintingMessageFilter::UpdateFileDescriptor(int render_view_id, int fd) {
 | 
				
			||||||
void PrintingMessageFilter::OnUpdatePrintSettings(
 | 
					void PrintingMessageFilter::OnUpdatePrintSettings(
 | 
				
			||||||
    int document_cookie, const base::DictionaryValue& job_settings,
 | 
					    int document_cookie, const base::DictionaryValue& job_settings,
 | 
				
			||||||
    IPC::Message* reply_msg) {
 | 
					    IPC::Message* reply_msg) {
 | 
				
			||||||
  scoped_ptr<base::DictionaryValue> new_settings(job_settings.DeepCopy());
 | 
					  std::unique_ptr<base::DictionaryValue> new_settings(job_settings.DeepCopy());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_refptr<PrinterQuery> printer_query;
 | 
					  scoped_refptr<PrinterQuery> printer_query;
 | 
				
			||||||
  printer_query = queue_->PopPrinterQuery(document_cookie);
 | 
					  printer_query = queue_->PopPrinterQuery(document_cookie);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ ChromeBrowserPepperHostFactory::ChromeBrowserPepperHostFactory(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ChromeBrowserPepperHostFactory::~ChromeBrowserPepperHostFactory() {}
 | 
					ChromeBrowserPepperHostFactory::~ChromeBrowserPepperHostFactory() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
scoped_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost(
 | 
					std::unique_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
    ppapi::host::PpapiHost* host,
 | 
					    ppapi::host::PpapiHost* host,
 | 
				
			||||||
    PP_Resource resource,
 | 
					    PP_Resource resource,
 | 
				
			||||||
    PP_Instance instance,
 | 
					    PP_Instance instance,
 | 
				
			||||||
| 
						 | 
					@ -38,7 +38,7 @@ scoped_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Make sure the plugin is giving us a valid instance for this resource.
 | 
					  // Make sure the plugin is giving us a valid instance for this resource.
 | 
				
			||||||
  if (!host_->IsValidInstance(instance))
 | 
					  if (!host_->IsValidInstance(instance))
 | 
				
			||||||
    return scoped_ptr<ResourceHost>();
 | 
					    return std::unique_ptr<ResourceHost>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Private interfaces.
 | 
					  // Private interfaces.
 | 
				
			||||||
  if (host_->GetPpapiHost()->permissions().HasPermission(
 | 
					  if (host_->GetPpapiHost()->permissions().HasPermission(
 | 
				
			||||||
| 
						 | 
					@ -47,7 +47,7 @@ scoped_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
      case PpapiHostMsg_Broker_Create::ID: {
 | 
					      case PpapiHostMsg_Broker_Create::ID: {
 | 
				
			||||||
        scoped_refptr<ResourceMessageFilter> broker_filter(
 | 
					        scoped_refptr<ResourceMessageFilter> broker_filter(
 | 
				
			||||||
            new PepperBrokerMessageFilter(instance, host_));
 | 
					            new PepperBrokerMessageFilter(instance, host_));
 | 
				
			||||||
        return scoped_ptr<ResourceHost>(new MessageFilterHost(
 | 
					        return std::unique_ptr<ResourceHost>(new MessageFilterHost(
 | 
				
			||||||
            host_->GetPpapiHost(), instance, resource, broker_filter));
 | 
					            host_->GetPpapiHost(), instance, resource, broker_filter));
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -58,16 +58,16 @@ scoped_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
          ppapi::PERMISSION_FLASH)) {
 | 
					          ppapi::PERMISSION_FLASH)) {
 | 
				
			||||||
    switch (message.type()) {
 | 
					    switch (message.type()) {
 | 
				
			||||||
      case PpapiHostMsg_Flash_Create::ID:
 | 
					      case PpapiHostMsg_Flash_Create::ID:
 | 
				
			||||||
        return scoped_ptr<ResourceHost>(
 | 
					        return std::unique_ptr<ResourceHost>(
 | 
				
			||||||
            new PepperFlashBrowserHost(host_, instance, resource));
 | 
					            new PepperFlashBrowserHost(host_, instance, resource));
 | 
				
			||||||
      case PpapiHostMsg_FlashClipboard_Create::ID: {
 | 
					      case PpapiHostMsg_FlashClipboard_Create::ID: {
 | 
				
			||||||
        scoped_refptr<ResourceMessageFilter> clipboard_filter(
 | 
					        scoped_refptr<ResourceMessageFilter> clipboard_filter(
 | 
				
			||||||
            new PepperFlashClipboardMessageFilter);
 | 
					            new PepperFlashClipboardMessageFilter);
 | 
				
			||||||
        return scoped_ptr<ResourceHost>(new MessageFilterHost(
 | 
					        return std::unique_ptr<ResourceHost>(new MessageFilterHost(
 | 
				
			||||||
            host_->GetPpapiHost(), instance, resource, clipboard_filter));
 | 
					            host_->GetPpapiHost(), instance, resource, clipboard_filter));
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      case PpapiHostMsg_FlashDRM_Create::ID:
 | 
					      case PpapiHostMsg_FlashDRM_Create::ID:
 | 
				
			||||||
        return scoped_ptr<ResourceHost>(
 | 
					        return std::unique_ptr<ResourceHost>(
 | 
				
			||||||
            new chrome::PepperFlashDRMHost(host_, instance, resource));
 | 
					            new chrome::PepperFlashDRMHost(host_, instance, resource));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					@ -82,12 +82,12 @@ scoped_ptr<ResourceHost> ChromeBrowserPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
    PepperIsolatedFileSystemMessageFilter* isolated_fs_filter =
 | 
					    PepperIsolatedFileSystemMessageFilter* isolated_fs_filter =
 | 
				
			||||||
        PepperIsolatedFileSystemMessageFilter::Create(instance, host_);
 | 
					        PepperIsolatedFileSystemMessageFilter::Create(instance, host_);
 | 
				
			||||||
    if (!isolated_fs_filter)
 | 
					    if (!isolated_fs_filter)
 | 
				
			||||||
      return scoped_ptr<ResourceHost>();
 | 
					      return std::unique_ptr<ResourceHost>();
 | 
				
			||||||
    return scoped_ptr<ResourceHost>(
 | 
					    return std::unique_ptr<ResourceHost>(
 | 
				
			||||||
        new MessageFilterHost(host, instance, resource, isolated_fs_filter));
 | 
					        new MessageFilterHost(host, instance, resource, isolated_fs_filter));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return scoped_ptr<ResourceHost>();
 | 
					  return std::unique_ptr<ResourceHost>();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}  // namespace chrome
 | 
					}  // namespace chrome
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
#ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
 | 
					#ifndef CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
 | 
				
			||||||
#define CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
 | 
					#define CHROME_BROWSER_RENDERER_HOST_PEPPER_CHROME_BROWSER_PEPPER_HOST_FACTORY_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "base/compiler_specific.h"
 | 
					#include "base/macros.h"
 | 
				
			||||||
#include "ppapi/host/host_factory.h"
 | 
					#include "ppapi/host/host_factory.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace content {
 | 
					namespace content {
 | 
				
			||||||
| 
						 | 
					@ -20,7 +20,7 @@ class ChromeBrowserPepperHostFactory : public ppapi::host::HostFactory {
 | 
				
			||||||
  explicit ChromeBrowserPepperHostFactory(content::BrowserPpapiHost* host);
 | 
					  explicit ChromeBrowserPepperHostFactory(content::BrowserPpapiHost* host);
 | 
				
			||||||
  ~ChromeBrowserPepperHostFactory() override;
 | 
					  ~ChromeBrowserPepperHostFactory() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost(
 | 
					  std::unique_ptr<ppapi::host::ResourceHost> CreateResourceHost(
 | 
				
			||||||
      ppapi::host::PpapiHost* host,
 | 
					      ppapi::host::PpapiHost* host,
 | 
				
			||||||
      PP_Resource resource,
 | 
					      PP_Resource resource,
 | 
				
			||||||
      PP_Instance instance,
 | 
					      PP_Instance instance,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -240,7 +240,7 @@ class Utterance {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // The full options arg passed to tts.speak, which may include fields
 | 
					  // The full options arg passed to tts.speak, which may include fields
 | 
				
			||||||
  // other than the ones we explicitly parse, below.
 | 
					  // other than the ones we explicitly parse, below.
 | 
				
			||||||
  scoped_ptr<base::Value> options_;
 | 
					  std::unique_ptr<base::Value> options_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // The extension ID of the extension that called speak() and should
 | 
					  // The extension ID of the extension that called speak() and should
 | 
				
			||||||
  // receive events.
 | 
					  // receive events.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -81,7 +81,7 @@ class TtsPlatformImplLinux : public TtsPlatformImpl {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Map a string composed of a voicename and module to the voicename. Used to
 | 
					  // Map a string composed of a voicename and module to the voicename. Used to
 | 
				
			||||||
  // uniquely identify a voice across all available modules.
 | 
					  // uniquely identify a voice across all available modules.
 | 
				
			||||||
  scoped_ptr<std::map<std::string, SPDChromeVoice> > all_native_voices_;
 | 
					  std::unique_ptr<std::map<std::string, SPDChromeVoice> > all_native_voices_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  friend struct base::DefaultSingletonTraits<TtsPlatformImplLinux>;
 | 
					  friend struct base::DefaultSingletonTraits<TtsPlatformImplLinux>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -83,7 +83,7 @@ void TtsMessageFilter::OnInitializeVoiceList() {
 | 
				
			||||||
void TtsMessageFilter::OnSpeak(const TtsUtteranceRequest& request) {
 | 
					void TtsMessageFilter::OnSpeak(const TtsUtteranceRequest& request) {
 | 
				
			||||||
  CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 | 
					  CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<Utterance> utterance(new Utterance(browser_context_));
 | 
					  std::unique_ptr<Utterance> utterance(new Utterance(browser_context_));
 | 
				
			||||||
  utterance->set_src_id(request.id);
 | 
					  utterance->set_src_id(request.id);
 | 
				
			||||||
  utterance->set_text(request.text);
 | 
					  utterance->set_text(request.text);
 | 
				
			||||||
  utterance->set_lang(request.lang);
 | 
					  utterance->set_lang(request.lang);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -60,7 +60,7 @@ bool GetUserMediaDirectory(const std::string& xdg_name,
 | 
				
			||||||
// ~/.config/google-chrome/ for official builds.
 | 
					// ~/.config/google-chrome/ for official builds.
 | 
				
			||||||
// (This also helps us sidestep issues with other apps grabbing ~/.chromium .)
 | 
					// (This also helps us sidestep issues with other apps grabbing ~/.chromium .)
 | 
				
			||||||
bool GetDefaultUserDataDirectory(base::FilePath* result) {
 | 
					bool GetDefaultUserDataDirectory(base::FilePath* result) {
 | 
				
			||||||
  scoped_ptr<base::Environment> env(base::Environment::Create());
 | 
					  std::unique_ptr<base::Environment> env(base::Environment::Create());
 | 
				
			||||||
  base::FilePath config_dir(GetXDGDirectory(env.get(),
 | 
					  base::FilePath config_dir(GetXDGDirectory(env.get(),
 | 
				
			||||||
                                            kXdgConfigHomeEnvVar,
 | 
					                                            kXdgConfigHomeEnvVar,
 | 
				
			||||||
                                            kDotConfigDir));
 | 
					                                            kDotConfigDir));
 | 
				
			||||||
| 
						 | 
					@ -85,7 +85,7 @@ void GetUserCacheDirectory(const base::FilePath& profile_dir,
 | 
				
			||||||
  // Default value in cases where any of the following fails.
 | 
					  // Default value in cases where any of the following fails.
 | 
				
			||||||
  *result = profile_dir;
 | 
					  *result = profile_dir;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<base::Environment> env(base::Environment::Create());
 | 
					  std::unique_ptr<base::Environment> env(base::Environment::Create());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  base::FilePath cache_dir;
 | 
					  base::FilePath cache_dir;
 | 
				
			||||||
  if (!PathService::Get(base::DIR_CACHE, &cache_dir))
 | 
					  if (!PathService::Get(base::DIR_CACHE, &cache_dir))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@
 | 
				
			||||||
#include "base/logging.h"
 | 
					#include "base/logging.h"
 | 
				
			||||||
#import "base/mac/foundation_util.h"
 | 
					#import "base/mac/foundation_util.h"
 | 
				
			||||||
#import "base/mac/scoped_nsautorelease_pool.h"
 | 
					#import "base/mac/scoped_nsautorelease_pool.h"
 | 
				
			||||||
#include "base/memory/scoped_ptr.h"
 | 
					#include "base/memory/free_deleter.h"
 | 
				
			||||||
#include "base/path_service.h"
 | 
					#include "base/path_service.h"
 | 
				
			||||||
#include "chrome/common/chrome_constants.h"
 | 
					#include "chrome/common/chrome_constants.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -235,7 +235,7 @@ NSBundle* OuterAppBundle() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
bool GetUserDataDirectoryForBrowserBundle(NSBundle* bundle,
 | 
					bool GetUserDataDirectoryForBrowserBundle(NSBundle* bundle,
 | 
				
			||||||
                                          base::FilePath* result) {
 | 
					                                          base::FilePath* result) {
 | 
				
			||||||
  scoped_ptr<char, base::FreeDeleter>
 | 
					  std::unique_ptr<char, base::FreeDeleter>
 | 
				
			||||||
      product_dir_name(ProductDirNameForBundle(bundle));
 | 
					      product_dir_name(ProductDirNameForBundle(bundle));
 | 
				
			||||||
  return GetDefaultUserDataDirectoryForProduct(product_dir_name.get(), result);
 | 
					  return GetDefaultUserDataDirectoryForProduct(product_dir_name.get(), result);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,7 +24,7 @@ ChromeRendererPepperHostFactory::ChromeRendererPepperHostFactory(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ChromeRendererPepperHostFactory::~ChromeRendererPepperHostFactory() {}
 | 
					ChromeRendererPepperHostFactory::~ChromeRendererPepperHostFactory() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
scoped_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHost(
 | 
					std::unique_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
    ppapi::host::PpapiHost* host,
 | 
					    ppapi::host::PpapiHost* host,
 | 
				
			||||||
    PP_Resource resource,
 | 
					    PP_Resource resource,
 | 
				
			||||||
    PP_Instance instance,
 | 
					    PP_Instance instance,
 | 
				
			||||||
| 
						 | 
					@ -33,24 +33,24 @@ scoped_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Make sure the plugin is giving us a valid instance for this resource.
 | 
					  // Make sure the plugin is giving us a valid instance for this resource.
 | 
				
			||||||
  if (!host_->IsValidInstance(instance))
 | 
					  if (!host_->IsValidInstance(instance))
 | 
				
			||||||
    return scoped_ptr<ResourceHost>();
 | 
					    return std::unique_ptr<ResourceHost>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (host_->GetPpapiHost()->permissions().HasPermission(
 | 
					  if (host_->GetPpapiHost()->permissions().HasPermission(
 | 
				
			||||||
          ppapi::PERMISSION_FLASH)) {
 | 
					          ppapi::PERMISSION_FLASH)) {
 | 
				
			||||||
    switch (message.type()) {
 | 
					    switch (message.type()) {
 | 
				
			||||||
      case PpapiHostMsg_Flash_Create::ID: {
 | 
					      case PpapiHostMsg_Flash_Create::ID: {
 | 
				
			||||||
        return scoped_ptr<ResourceHost>(
 | 
					        return std::unique_ptr<ResourceHost>(
 | 
				
			||||||
            new PepperFlashRendererHost(host_, instance, resource));
 | 
					            new PepperFlashRendererHost(host_, instance, resource));
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      case PpapiHostMsg_FlashFullscreen_Create::ID: {
 | 
					      case PpapiHostMsg_FlashFullscreen_Create::ID: {
 | 
				
			||||||
        return scoped_ptr<ResourceHost>(
 | 
					        return std::unique_ptr<ResourceHost>(
 | 
				
			||||||
            new PepperFlashFullscreenHost(host_, instance, resource));
 | 
					            new PepperFlashFullscreenHost(host_, instance, resource));
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      case PpapiHostMsg_FlashMenu_Create::ID: {
 | 
					      case PpapiHostMsg_FlashMenu_Create::ID: {
 | 
				
			||||||
        ppapi::proxy::SerializedFlashMenu serialized_menu;
 | 
					        ppapi::proxy::SerializedFlashMenu serialized_menu;
 | 
				
			||||||
        if (ppapi::UnpackMessage<PpapiHostMsg_FlashMenu_Create>(
 | 
					        if (ppapi::UnpackMessage<PpapiHostMsg_FlashMenu_Create>(
 | 
				
			||||||
                message, &serialized_menu)) {
 | 
					                message, &serialized_menu)) {
 | 
				
			||||||
          return scoped_ptr<ResourceHost>(new PepperFlashMenuHost(
 | 
					          return std::unique_ptr<ResourceHost>(new PepperFlashMenuHost(
 | 
				
			||||||
              host_, instance, resource, serialized_menu));
 | 
					              host_, instance, resource, serialized_menu));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
| 
						 | 
					@ -71,7 +71,7 @@ scoped_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
        PP_PrivateFontCharset charset;
 | 
					        PP_PrivateFontCharset charset;
 | 
				
			||||||
        if (ppapi::UnpackMessage<PpapiHostMsg_FlashFontFile_Create>(
 | 
					        if (ppapi::UnpackMessage<PpapiHostMsg_FlashFontFile_Create>(
 | 
				
			||||||
                message, &description, &charset)) {
 | 
					                message, &description, &charset)) {
 | 
				
			||||||
          return scoped_ptr<ResourceHost>(new PepperFlashFontFileHost(
 | 
					          return std::unique_ptr<ResourceHost>(new PepperFlashFontFileHost(
 | 
				
			||||||
              host_, instance, resource, description, charset));
 | 
					              host_, instance, resource, description, charset));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        break;
 | 
					        break;
 | 
				
			||||||
| 
						 | 
					@ -79,5 +79,5 @@ scoped_ptr<ResourceHost> ChromeRendererPepperHostFactory::CreateResourceHost(
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return scoped_ptr<ResourceHost>();
 | 
					  return std::unique_ptr<ResourceHost>();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,6 +5,7 @@
 | 
				
			||||||
#ifndef CHROME_RENDERER_PEPPER_CHROME_RENDERER_PEPPER_HOST_FACTORY_H_
 | 
					#ifndef CHROME_RENDERER_PEPPER_CHROME_RENDERER_PEPPER_HOST_FACTORY_H_
 | 
				
			||||||
#define CHROME_RENDERER_PEPPER_CHROME_RENDERER_PEPPER_HOST_FACTORY_H_
 | 
					#define CHROME_RENDERER_PEPPER_CHROME_RENDERER_PEPPER_HOST_FACTORY_H_
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include "base/macros.h"
 | 
				
			||||||
#include "ppapi/host/host_factory.h"
 | 
					#include "ppapi/host/host_factory.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace content {
 | 
					namespace content {
 | 
				
			||||||
| 
						 | 
					@ -17,7 +18,7 @@ class ChromeRendererPepperHostFactory : public ppapi::host::HostFactory {
 | 
				
			||||||
  ~ChromeRendererPepperHostFactory() override;
 | 
					  ~ChromeRendererPepperHostFactory() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // HostFactory.
 | 
					  // HostFactory.
 | 
				
			||||||
  scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost(
 | 
					  std::unique_ptr<ppapi::host::ResourceHost> CreateResourceHost(
 | 
				
			||||||
      ppapi::host::PpapiHost* host,
 | 
					      ppapi::host::PpapiHost* host,
 | 
				
			||||||
      PP_Resource resource,
 | 
					      PP_Resource resource,
 | 
				
			||||||
      PP_Instance instance,
 | 
					      PP_Instance instance,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -205,7 +205,7 @@ int32_t PepperFlashRendererHost::OnDrawGlyphs(
 | 
				
			||||||
    style |= SkTypeface::kBold;
 | 
					    style |= SkTypeface::kBold;
 | 
				
			||||||
  if (params.font_desc.italic)
 | 
					  if (params.font_desc.italic)
 | 
				
			||||||
    style |= SkTypeface::kItalic;
 | 
					    style |= SkTypeface::kItalic;
 | 
				
			||||||
  skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(SkTypeface::CreateFromName(
 | 
					  sk_sp<SkTypeface> typeface(SkTypeface::CreateFromName(
 | 
				
			||||||
      params.font_desc.face.c_str(), static_cast<SkTypeface::Style>(style)));
 | 
					      params.font_desc.face.c_str(), static_cast<SkTypeface::Style>(style)));
 | 
				
			||||||
  if (!typeface)
 | 
					  if (!typeface)
 | 
				
			||||||
    return PP_ERROR_FAILED;
 | 
					    return PP_ERROR_FAILED;
 | 
				
			||||||
| 
						 | 
					@ -255,7 +255,7 @@ int32_t PepperFlashRendererHost::OnDrawGlyphs(
 | 
				
			||||||
  paint.setAntiAlias(true);
 | 
					  paint.setAntiAlias(true);
 | 
				
			||||||
  paint.setHinting(SkPaint::kFull_Hinting);
 | 
					  paint.setHinting(SkPaint::kFull_Hinting);
 | 
				
			||||||
  paint.setTextSize(SkIntToScalar(params.font_desc.size));
 | 
					  paint.setTextSize(SkIntToScalar(params.font_desc.size));
 | 
				
			||||||
  paint.setTypeface(typeface.get());  // Takes a ref and manages lifetime.
 | 
					  paint.setTypeface(std::move(typeface));
 | 
				
			||||||
  if (params.allow_subpixel_aa) {
 | 
					  if (params.allow_subpixel_aa) {
 | 
				
			||||||
    paint.setSubpixelText(true);
 | 
					    paint.setSubpixelText(true);
 | 
				
			||||||
    paint.setLCDRenderText(true);
 | 
					    paint.setLCDRenderText(true);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,9 +18,9 @@ void PepperHelper::DidCreatePepperPlugin(content::RendererPpapiHost* host) {
 | 
				
			||||||
  // TODO(brettw) figure out how to hook up the host factory. It needs some
 | 
					  // TODO(brettw) figure out how to hook up the host factory. It needs some
 | 
				
			||||||
  // kind of filter-like system to allow dynamic additions.
 | 
					  // kind of filter-like system to allow dynamic additions.
 | 
				
			||||||
  host->GetPpapiHost()->AddHostFactoryFilter(
 | 
					  host->GetPpapiHost()->AddHostFactoryFilter(
 | 
				
			||||||
      scoped_ptr<ppapi::host::HostFactory>(
 | 
					      std::unique_ptr<ppapi::host::HostFactory>(
 | 
				
			||||||
          new ChromeRendererPepperHostFactory(host)));
 | 
					          new ChromeRendererPepperHostFactory(host)));
 | 
				
			||||||
  host->GetPpapiHost()->AddInstanceMessageFilter(
 | 
					  host->GetPpapiHost()->AddInstanceMessageFilter(
 | 
				
			||||||
      scoped_ptr<ppapi::host::InstanceMessageFilter>(
 | 
					      std::unique_ptr<ppapi::host::InstanceMessageFilter>(
 | 
				
			||||||
          new PepperSharedMemoryMessageFilter(host)));
 | 
					          new PepperSharedMemoryMessageFilter(host)));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,7 +43,7 @@ void PepperSharedMemoryMessageFilter::OnHostMsgCreateSharedMemory(
 | 
				
			||||||
    ppapi::proxy::SerializedHandle* plugin_handle) {
 | 
					    ppapi::proxy::SerializedHandle* plugin_handle) {
 | 
				
			||||||
  plugin_handle->set_null_shmem();
 | 
					  plugin_handle->set_null_shmem();
 | 
				
			||||||
  *host_handle_id = -1;
 | 
					  *host_handle_id = -1;
 | 
				
			||||||
  scoped_ptr<base::SharedMemory> shm(
 | 
					  std::unique_ptr<base::SharedMemory> shm(
 | 
				
			||||||
      content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(size));
 | 
					      content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(size));
 | 
				
			||||||
  if (!shm.get())
 | 
					  if (!shm.get())
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1169,7 +1169,7 @@ bool PrintWebViewHelper::CopyMetafileDataToSharedMem(
 | 
				
			||||||
  if (buf_size == 0)
 | 
					  if (buf_size == 0)
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<base::SharedMemory> shared_buf(
 | 
					  std::unique_ptr<base::SharedMemory> shared_buf(
 | 
				
			||||||
      content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(buf_size));
 | 
					      content::RenderThread::Get()->HostAllocateSharedMemoryBuffer(buf_size));
 | 
				
			||||||
  if (!shared_buf)
 | 
					  if (!shared_buf)
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -244,10 +244,10 @@ class PrintWebViewHelper
 | 
				
			||||||
  void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
 | 
					  void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // WebView used only to print the selection.
 | 
					  // WebView used only to print the selection.
 | 
				
			||||||
  scoped_ptr<PrepareFrameAndViewForPrint> prep_frame_view_;
 | 
					  std::unique_ptr<PrepareFrameAndViewForPrint> prep_frame_view_;
 | 
				
			||||||
  bool reset_prep_frame_view_;
 | 
					  bool reset_prep_frame_view_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<PrintMsg_PrintPages_Params> print_pages_params_;
 | 
					  std::unique_ptr<PrintMsg_PrintPages_Params> print_pages_params_;
 | 
				
			||||||
  bool is_print_ready_metafile_sent_;
 | 
					  bool is_print_ready_metafile_sent_;
 | 
				
			||||||
  bool ignore_css_margins_;
 | 
					  bool ignore_css_margins_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -343,8 +343,8 @@ class PrintWebViewHelper
 | 
				
			||||||
    FrameReference source_frame_;
 | 
					    FrameReference source_frame_;
 | 
				
			||||||
    blink::WebNode source_node_;
 | 
					    blink::WebNode source_node_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    scoped_ptr<PrepareFrameAndViewForPrint> prep_frame_view_;
 | 
					    std::unique_ptr<PrepareFrameAndViewForPrint> prep_frame_view_;
 | 
				
			||||||
    scoped_ptr<PdfMetafileSkia> metafile_;
 | 
					    std::unique_ptr<PdfMetafileSkia> metafile_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Total page count in the renderer.
 | 
					    // Total page count in the renderer.
 | 
				
			||||||
    int total_page_count_;
 | 
					    int total_page_count_;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -29,7 +29,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
 | 
				
			||||||
  PrintMsg_PrintPage_Params page_params;
 | 
					  PrintMsg_PrintPage_Params page_params;
 | 
				
			||||||
  page_params.params = print_params;
 | 
					  page_params.params = print_params;
 | 
				
			||||||
  page_params.page_number = page_number;
 | 
					  page_params.page_number = page_number;
 | 
				
			||||||
  scoped_ptr<PdfMetafileSkia> draft_metafile;
 | 
					  std::unique_ptr<PdfMetafileSkia> draft_metafile;
 | 
				
			||||||
  PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
 | 
					  PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
 | 
				
			||||||
  if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
 | 
					  if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
 | 
				
			||||||
    draft_metafile.reset(new PdfMetafileSkia);
 | 
					    draft_metafile.reset(new PdfMetafileSkia);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
 | 
				
			||||||
    int page_number,
 | 
					    int page_number,
 | 
				
			||||||
    const PrintMsg_Print_Params& print_params) {
 | 
					    const PrintMsg_Print_Params& print_params) {
 | 
				
			||||||
  PrintMsg_Print_Params printParams = print_params;
 | 
					  PrintMsg_Print_Params printParams = print_params;
 | 
				
			||||||
  scoped_ptr<PdfMetafileSkia> draft_metafile;
 | 
					  std::unique_ptr<PdfMetafileSkia> draft_metafile;
 | 
				
			||||||
  PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
 | 
					  PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bool render_to_draft = print_preview_context_.IsModifiable() &&
 | 
					  bool render_to_draft = print_preview_context_.IsModifiable() &&
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,7 @@ bool PrintWebViewHelper::RenderPreviewPage(
 | 
				
			||||||
  PrintMsg_PrintPage_Params page_params;
 | 
					  PrintMsg_PrintPage_Params page_params;
 | 
				
			||||||
  page_params.params = print_params;
 | 
					  page_params.params = print_params;
 | 
				
			||||||
  page_params.page_number = page_number;
 | 
					  page_params.page_number = page_number;
 | 
				
			||||||
  scoped_ptr<PdfMetafileSkia> draft_metafile;
 | 
					  std::unique_ptr<PdfMetafileSkia> draft_metafile;
 | 
				
			||||||
  PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
 | 
					  PdfMetafileSkia* initial_render_metafile = print_preview_context_.metafile();
 | 
				
			||||||
  if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
 | 
					  if (print_preview_context_.IsModifiable() && is_print_ready_metafile_sent_) {
 | 
				
			||||||
    draft_metafile.reset(new PdfMetafileSkia);
 | 
					    draft_metafile.reset(new PdfMetafileSkia);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -322,7 +322,7 @@ bool SpellcheckWordIterator::Initialize(
 | 
				
			||||||
  if (rule.empty())
 | 
					  if (rule.empty())
 | 
				
			||||||
    return false;
 | 
					    return false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  scoped_ptr<base::i18n::BreakIterator> iterator(
 | 
					  std::unique_ptr<base::i18n::BreakIterator> iterator(
 | 
				
			||||||
      new base::i18n::BreakIterator(base::string16(), rule));
 | 
					      new base::i18n::BreakIterator(base::string16(), rule));
 | 
				
			||||||
  if (!iterator->Init()) {
 | 
					  if (!iterator->Init()) {
 | 
				
			||||||
    // Since we're not passing in any text, the only reason this could fail
 | 
					    // Since we're not passing in any text, the only reason this could fail
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -167,7 +167,7 @@ class SpellcheckWordIterator {
 | 
				
			||||||
  const SpellcheckCharAttribute* attribute_;
 | 
					  const SpellcheckCharAttribute* attribute_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // The break iterator.
 | 
					  // The break iterator.
 | 
				
			||||||
  scoped_ptr<base::i18n::BreakIterator> iterator_;
 | 
					  std::unique_ptr<base::i18n::BreakIterator> iterator_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DISALLOW_COPY_AND_ASSIGN(SpellcheckWordIterator);
 | 
					  DISALLOW_COPY_AND_ASSIGN(SpellcheckWordIterator);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,7 +58,7 @@ class StreamListenSocket :
 | 
				
			||||||
    // |server| is the original listening Socket, connection is the new
 | 
					    // |server| is the original listening Socket, connection is the new
 | 
				
			||||||
    // Socket that was created.
 | 
					    // Socket that was created.
 | 
				
			||||||
    virtual void DidAccept(StreamListenSocket* server,
 | 
					    virtual void DidAccept(StreamListenSocket* server,
 | 
				
			||||||
                           scoped_ptr<StreamListenSocket> connection) = 0;
 | 
					                           std::unique_ptr<StreamListenSocket> connection) = 0;
 | 
				
			||||||
    virtual void DidRead(StreamListenSocket* connection,
 | 
					    virtual void DidRead(StreamListenSocket* connection,
 | 
				
			||||||
                         const char* data,
 | 
					                         const char* data,
 | 
				
			||||||
                         int len) = 0;
 | 
					                         int len) = 0;
 | 
				
			||||||
| 
						 | 
					@ -140,7 +140,7 @@ class StreamListenSocketFactory {
 | 
				
			||||||
  virtual ~StreamListenSocketFactory() {}
 | 
					  virtual ~StreamListenSocketFactory() {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Returns a new instance of StreamListenSocket or NULL if an error occurred.
 | 
					  // Returns a new instance of StreamListenSocket or NULL if an error occurred.
 | 
				
			||||||
  virtual scoped_ptr<StreamListenSocket> CreateAndListen(
 | 
					  virtual std::unique_ptr<StreamListenSocket> CreateAndListen(
 | 
				
			||||||
      StreamListenSocket::Delegate* delegate) const = 0;
 | 
					      StreamListenSocket::Delegate* delegate) const = 0;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,14 +33,14 @@ namespace net {
 | 
				
			||||||
namespace test_server {
 | 
					namespace test_server {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// static
 | 
					// static
 | 
				
			||||||
scoped_ptr<TCPListenSocket> TCPListenSocket::CreateAndListen(
 | 
					std::unique_ptr<TCPListenSocket> TCPListenSocket::CreateAndListen(
 | 
				
			||||||
    const string& ip,
 | 
					    const string& ip,
 | 
				
			||||||
    uint16_t port,
 | 
					    uint16_t port,
 | 
				
			||||||
    StreamListenSocket::Delegate* del) {
 | 
					    StreamListenSocket::Delegate* del) {
 | 
				
			||||||
  SocketDescriptor s = CreateAndBind(ip, port);
 | 
					  SocketDescriptor s = CreateAndBind(ip, port);
 | 
				
			||||||
  if (s == kInvalidSocket)
 | 
					  if (s == kInvalidSocket)
 | 
				
			||||||
    return scoped_ptr<TCPListenSocket>();
 | 
					    return std::unique_ptr<TCPListenSocket>();
 | 
				
			||||||
  scoped_ptr<TCPListenSocket> sock(new TCPListenSocket(s, del));
 | 
					  std::unique_ptr<TCPListenSocket> sock(new TCPListenSocket(s, del));
 | 
				
			||||||
  sock->Listen();
 | 
					  sock->Listen();
 | 
				
			||||||
  return sock;
 | 
					  return sock;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -108,7 +108,7 @@ void TCPListenSocket::Accept() {
 | 
				
			||||||
  SocketDescriptor conn = AcceptSocket();
 | 
					  SocketDescriptor conn = AcceptSocket();
 | 
				
			||||||
  if (conn == kInvalidSocket)
 | 
					  if (conn == kInvalidSocket)
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
  scoped_ptr<TCPListenSocket> sock(new TCPListenSocket(conn, socket_delegate_));
 | 
					  std::unique_ptr<TCPListenSocket> sock(new TCPListenSocket(conn, socket_delegate_));
 | 
				
			||||||
#if defined(OS_POSIX)
 | 
					#if defined(OS_POSIX)
 | 
				
			||||||
  sock->WatchSocket(WAITING_READ);
 | 
					  sock->WatchSocket(WAITING_READ);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,7 +23,7 @@ class TCPListenSocket : public StreamListenSocket {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Listen on port for the specified IP address.  Use 127.0.0.1 to only
 | 
					  // Listen on port for the specified IP address.  Use 127.0.0.1 to only
 | 
				
			||||||
  // accept local connections.
 | 
					  // accept local connections.
 | 
				
			||||||
  static scoped_ptr<TCPListenSocket> CreateAndListen(
 | 
					  static std::unique_ptr<TCPListenSocket> CreateAndListen(
 | 
				
			||||||
      const std::string& ip,
 | 
					      const std::string& ip,
 | 
				
			||||||
      uint16_t port,
 | 
					      uint16_t port,
 | 
				
			||||||
      StreamListenSocket::Delegate* del);
 | 
					      StreamListenSocket::Delegate* del);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										2
									
								
								vendor/brightray
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/brightray
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
Subproject commit 3f18ef50c26a6cea42845292abe076fb627f5ef1
 | 
					Subproject commit 2f3fbc1594aae7a44498897c0d790f42b2a31e0a
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue