Fix API changes
This commit is contained in:
		
					parent
					
						
							
								80dd72b93c
							
						
					
				
			
			
				commit
				
					
						90b255f2cd
					
				
			
		
					 6 changed files with 40 additions and 31 deletions
				
			
		| 
						 | 
					@ -50,17 +50,24 @@ const char kTargetTypeOther[] = "other";
 | 
				
			||||||
class TCPServerSocketFactory
 | 
					class TCPServerSocketFactory
 | 
				
			||||||
    : public content::DevToolsHttpHandler::ServerSocketFactory {
 | 
					    : public content::DevToolsHttpHandler::ServerSocketFactory {
 | 
				
			||||||
 public:
 | 
					 public:
 | 
				
			||||||
  TCPServerSocketFactory(const std::string& address, int port, int backlog)
 | 
					  TCPServerSocketFactory(const std::string& address, int port)
 | 
				
			||||||
      : content::DevToolsHttpHandler::ServerSocketFactory(
 | 
					      : address_(address), port_(port) {
 | 
				
			||||||
            address, port, backlog) {}
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  // content::DevToolsHttpHandler::ServerSocketFactory.
 | 
					  // content::DevToolsHttpHandler::ServerSocketFactory.
 | 
				
			||||||
  scoped_ptr<net::ServerSocket> Create() const override {
 | 
					  scoped_ptr<net::ServerSocket> CreateForHttpServer() override {
 | 
				
			||||||
    return scoped_ptr<net::ServerSocket>(
 | 
					    scoped_ptr<net::ServerSocket> socket(
 | 
				
			||||||
        new net::TCPServerSocket(NULL, net::NetLog::Source()));
 | 
					        new net::TCPServerSocket(nullptr, net::NetLog::Source()));
 | 
				
			||||||
 | 
					    if (socket->ListenWithAddressAndPort(address_, port_, 10) != net::OK)
 | 
				
			||||||
 | 
					      return scoped_ptr<net::ServerSocket>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return socket;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  std::string address_;
 | 
				
			||||||
 | 
					  uint16 port_;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
 | 
					  DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -82,7 +89,7 @@ CreateSocketFactory() {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  return scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>(
 | 
					  return scoped_ptr<content::DevToolsHttpHandler::ServerSocketFactory>(
 | 
				
			||||||
      new TCPServerSocketFactory("127.0.0.1", port, 1));
 | 
					      new TCPServerSocketFactory("127.0.0.1", port));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Target : public content::DevToolsTarget {
 | 
					class Target : public content::DevToolsTarget {
 | 
				
			||||||
| 
						 | 
					@ -152,8 +159,6 @@ class DevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
 | 
				
			||||||
  std::string GetDiscoveryPageHTML() override;
 | 
					  std::string GetDiscoveryPageHTML() override;
 | 
				
			||||||
  bool BundlesFrontendResources() override;
 | 
					  bool BundlesFrontendResources() override;
 | 
				
			||||||
  base::FilePath GetDebugFrontendDir() override;
 | 
					  base::FilePath GetDebugFrontendDir() override;
 | 
				
			||||||
  scoped_ptr<net::ServerSocket> CreateSocketForTethering(
 | 
					 | 
				
			||||||
      std::string* name) override;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 private:
 | 
					 private:
 | 
				
			||||||
  DISALLOW_COPY_AND_ASSIGN(DevToolsDelegate);
 | 
					  DISALLOW_COPY_AND_ASSIGN(DevToolsDelegate);
 | 
				
			||||||
| 
						 | 
					@ -178,11 +183,6 @@ base::FilePath DevToolsDelegate::GetDebugFrontendDir() {
 | 
				
			||||||
  return base::FilePath();
 | 
					  return base::FilePath();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
scoped_ptr<net::ServerSocket> DevToolsDelegate::CreateSocketForTethering(
 | 
					 | 
				
			||||||
    std::string* name) {
 | 
					 | 
				
			||||||
  return scoped_ptr<net::ServerSocket>();
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}  // namespace
 | 
					}  // namespace
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// DevToolsManagerDelegate ---------------------------------------------------
 | 
					// DevToolsManagerDelegate ---------------------------------------------------
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -324,6 +324,7 @@ void InspectableWebContentsImpl::AgentHostClosed(
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void InspectableWebContentsImpl::AboutToNavigateRenderFrame(
 | 
					void InspectableWebContentsImpl::AboutToNavigateRenderFrame(
 | 
				
			||||||
 | 
					    content::RenderFrameHost* old_host,
 | 
				
			||||||
    content::RenderFrameHost* new_host) {
 | 
					    content::RenderFrameHost* new_host) {
 | 
				
			||||||
  if (new_host->GetParent())
 | 
					  if (new_host->GetParent())
 | 
				
			||||||
    return;
 | 
					    return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -104,7 +104,8 @@ class InspectableWebContentsImpl :
 | 
				
			||||||
                       bool replaced) override;
 | 
					                       bool replaced) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // content::WebContentsObserver:
 | 
					  // content::WebContentsObserver:
 | 
				
			||||||
  void AboutToNavigateRenderFrame(content::RenderFrameHost* new_host) override;
 | 
					  void AboutToNavigateRenderFrame(content::RenderFrameHost* old_host,
 | 
				
			||||||
 | 
					                                  content::RenderFrameHost* new_host) override;
 | 
				
			||||||
  void DidFinishLoad(content::RenderFrameHost* render_frame_host,
 | 
					  void DidFinishLoad(content::RenderFrameHost* render_frame_host,
 | 
				
			||||||
                     const GURL& validated_url) override;
 | 
					                     const GURL& validated_url) override;
 | 
				
			||||||
  void WebContentsDestroyed() override;
 | 
					  void WebContentsDestroyed() override;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -27,7 +27,14 @@ NotificationPresenter* PlatformNotificationServiceImpl::notification_presenter()
 | 
				
			||||||
  return notification_presenter_.get();
 | 
					  return notification_presenter_.get();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
blink::WebNotificationPermission PlatformNotificationServiceImpl::CheckPermission(
 | 
					blink::WebNotificationPermission PlatformNotificationServiceImpl::CheckPermissionOnUIThread(
 | 
				
			||||||
 | 
					    content::BrowserContext* browser_context,
 | 
				
			||||||
 | 
					    const GURL& origin,
 | 
				
			||||||
 | 
					    int render_process_id) {
 | 
				
			||||||
 | 
					  return blink::WebNotificationPermissionAllowed;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					blink::WebNotificationPermission PlatformNotificationServiceImpl::CheckPermissionOnIOThread(
 | 
				
			||||||
    content::ResourceContext* resource_context,
 | 
					    content::ResourceContext* resource_context,
 | 
				
			||||||
    const GURL& origin,
 | 
					    const GURL& origin,
 | 
				
			||||||
    int render_process_id) {
 | 
					    int render_process_id) {
 | 
				
			||||||
| 
						 | 
					@ -40,7 +47,6 @@ void PlatformNotificationServiceImpl::DisplayNotification(
 | 
				
			||||||
    const SkBitmap& icon,
 | 
					    const SkBitmap& icon,
 | 
				
			||||||
    const content::PlatformNotificationData& notification_data,
 | 
					    const content::PlatformNotificationData& notification_data,
 | 
				
			||||||
    scoped_ptr<content::DesktopNotificationDelegate> delegate,
 | 
					    scoped_ptr<content::DesktopNotificationDelegate> delegate,
 | 
				
			||||||
    int render_process_id,
 | 
					 | 
				
			||||||
    base::Closure* cancel_callback) {
 | 
					    base::Closure* cancel_callback) {
 | 
				
			||||||
  auto presenter = notification_presenter();
 | 
					  auto presenter = notification_presenter();
 | 
				
			||||||
  if (presenter)
 | 
					  if (presenter)
 | 
				
			||||||
| 
						 | 
					@ -49,11 +55,10 @@ void PlatformNotificationServiceImpl::DisplayNotification(
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PlatformNotificationServiceImpl::DisplayPersistentNotification(
 | 
					void PlatformNotificationServiceImpl::DisplayPersistentNotification(
 | 
				
			||||||
    content::BrowserContext* browser_context,
 | 
					    content::BrowserContext* browser_context,
 | 
				
			||||||
    int64 service_worker_registration_id,
 | 
					    int64_t service_worker_registration_id,
 | 
				
			||||||
    const GURL& origin,
 | 
					    const GURL& origin,
 | 
				
			||||||
    const SkBitmap& icon,
 | 
					    const SkBitmap& icon,
 | 
				
			||||||
    const content::PlatformNotificationData& notification_data,
 | 
					    const content::PlatformNotificationData& notification_data) {
 | 
				
			||||||
    int render_process_id) {
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PlatformNotificationServiceImpl::ClosePersistentNotification(
 | 
					void PlatformNotificationServiceImpl::ClosePersistentNotification(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -28,26 +28,28 @@ class PlatformNotificationServiceImpl
 | 
				
			||||||
  ~PlatformNotificationServiceImpl() override;
 | 
					  ~PlatformNotificationServiceImpl() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // content::PlatformNotificationService:
 | 
					  // content::PlatformNotificationService:
 | 
				
			||||||
  virtual blink::WebNotificationPermission CheckPermission(
 | 
					  blink::WebNotificationPermission CheckPermissionOnUIThread(
 | 
				
			||||||
 | 
					      content::BrowserContext* browser_context,
 | 
				
			||||||
 | 
					      const GURL& origin,
 | 
				
			||||||
 | 
					      int render_process_id) override;
 | 
				
			||||||
 | 
					  blink::WebNotificationPermission CheckPermissionOnIOThread(
 | 
				
			||||||
      content::ResourceContext* resource_context,
 | 
					      content::ResourceContext* resource_context,
 | 
				
			||||||
      const GURL& origin,
 | 
					      const GURL& origin,
 | 
				
			||||||
      int render_process_id) override;
 | 
					      int render_process_id) override;
 | 
				
			||||||
  virtual void DisplayNotification(
 | 
					  void DisplayNotification(
 | 
				
			||||||
      content::BrowserContext* browser_context,
 | 
					      content::BrowserContext* browser_context,
 | 
				
			||||||
      const GURL& origin,
 | 
					      const GURL& origin,
 | 
				
			||||||
      const SkBitmap& icon,
 | 
					      const SkBitmap& icon,
 | 
				
			||||||
      const content::PlatformNotificationData& notification_data,
 | 
					      const content::PlatformNotificationData& notification_data,
 | 
				
			||||||
      scoped_ptr<content::DesktopNotificationDelegate> delegate,
 | 
					      scoped_ptr<content::DesktopNotificationDelegate> delegate,
 | 
				
			||||||
      int render_process_id,
 | 
					 | 
				
			||||||
      base::Closure* cancel_callback) override;
 | 
					      base::Closure* cancel_callback) override;
 | 
				
			||||||
  virtual void DisplayPersistentNotification(
 | 
					  void DisplayPersistentNotification(
 | 
				
			||||||
      content::BrowserContext* browser_context,
 | 
					      content::BrowserContext* browser_context,
 | 
				
			||||||
      int64 service_worker_registration_id,
 | 
					      int64_t service_worker_registration_id,
 | 
				
			||||||
      const GURL& origin,
 | 
					      const GURL& origin,
 | 
				
			||||||
      const SkBitmap& icon,
 | 
					      const SkBitmap& icon,
 | 
				
			||||||
      const content::PlatformNotificationData& notification_data,
 | 
					      const content::PlatformNotificationData& notification_data) override;
 | 
				
			||||||
      int render_process_id) override;
 | 
					  void ClosePersistentNotification(
 | 
				
			||||||
  virtual void ClosePersistentNotification(
 | 
					 | 
				
			||||||
      content::BrowserContext* browser_context,
 | 
					      content::BrowserContext* browser_context,
 | 
				
			||||||
      const std::string& persistent_notification_id) override;
 | 
					      const std::string& persistent_notification_id) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -154,9 +154,9 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
 | 
				
			||||||
        content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
 | 
					        content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
 | 
				
			||||||
        NULL, NULL);
 | 
					        NULL, NULL);
 | 
				
			||||||
    storage_->set_cookie_store(content::CreateCookieStore(cookie_config));
 | 
					    storage_->set_cookie_store(content::CreateCookieStore(cookie_config));
 | 
				
			||||||
    storage_->set_channel_id_service(new net::ChannelIDService(
 | 
					    storage_->set_channel_id_service(make_scoped_ptr(
 | 
				
			||||||
        new net::DefaultChannelIDStore(NULL),
 | 
					        new net::ChannelIDService(new net::DefaultChannelIDStore(NULL),
 | 
				
			||||||
        base::WorkerPool::GetTaskRunner(true)));
 | 
					                                  base::WorkerPool::GetTaskRunner(true))));
 | 
				
			||||||
    storage_->set_http_user_agent_settings(new net::StaticHttpUserAgentSettings(
 | 
					    storage_->set_http_user_agent_settings(new net::StaticHttpUserAgentSettings(
 | 
				
			||||||
        "en-us,en", base::EmptyString()));
 | 
					        "en-us,en", base::EmptyString()));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue