commit
e65f0941e0
11 changed files with 94 additions and 33 deletions
|
@ -15,6 +15,7 @@
|
|||
'<(libchromiumcontent_src_dir)',
|
||||
'<(libchromiumcontent_src_dir)/skia/config',
|
||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
||||
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
||||
'<(libchromiumcontent_src_dir)/third_party/WebKit',
|
||||
'<(libchromiumcontent_dir)/gen',
|
||||
],
|
||||
|
@ -26,6 +27,7 @@
|
|||
'<(libchromiumcontent_src_dir)/skia/config',
|
||||
'<(libchromiumcontent_src_dir)/third_party/skia/include/core',
|
||||
'<(libchromiumcontent_src_dir)/third_party/icu/source/common',
|
||||
'<(libchromiumcontent_src_dir)/third_party/mojo/src',
|
||||
'<(libchromiumcontent_src_dir)/third_party/WebKit',
|
||||
'<(libchromiumcontent_dir)/gen',
|
||||
],
|
||||
|
@ -137,6 +139,8 @@
|
|||
'$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
|
||||
# content_browser.gypi:
|
||||
'$(SDKROOT)/usr/lib/libbsm.dylib',
|
||||
# bluetooth.gyp:
|
||||
'$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework',
|
||||
],
|
||||
},
|
||||
}],
|
||||
|
|
|
@ -119,6 +119,8 @@
|
|||
'defines': [
|
||||
# We are using Release version libchromiumcontent:
|
||||
'NDEBUG',
|
||||
# Needed by gin:
|
||||
'V8_USE_EXTERNAL_STARTUP_DATA',
|
||||
# From skia_for_chromium_defines.gypi:
|
||||
'SK_SUPPORT_LEGACY_GETTOPDEVICE',
|
||||
'SK_SUPPORT_LEGACY_BITMAP_CONFIG',
|
||||
|
|
|
@ -12,7 +12,9 @@
|
|||
|
||||
#include "base/base_paths.h"
|
||||
#include "base/path_service.h"
|
||||
#include "content/public/common/content_descriptors.h"
|
||||
#include "content/public/common/url_constants.h"
|
||||
#include "gin/public/isolate_holder.h"
|
||||
|
||||
namespace brightray {
|
||||
|
||||
|
@ -27,9 +29,14 @@ BrowserClient* BrowserClient::Get() {
|
|||
}
|
||||
|
||||
BrowserClient::BrowserClient()
|
||||
: browser_main_parts_() {
|
||||
: browser_main_parts_(nullptr) {
|
||||
DCHECK(!g_browser_client);
|
||||
g_browser_client = this;
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
||||
v8_natives_fd_.reset(-1);
|
||||
v8_snapshot_fd_.reset(-1);
|
||||
#endif // OS_POSIX && !OS_MACOSX
|
||||
}
|
||||
|
||||
BrowserClient::~BrowserClient() {
|
||||
|
@ -86,4 +93,31 @@ content::DevToolsManagerDelegate* BrowserClient::GetDevToolsManagerDelegate() {
|
|||
return new DevToolsManagerDelegate;
|
||||
}
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
||||
void BrowserClient::GetAdditionalMappedFilesForChildProcess(
|
||||
const base::CommandLine& command_line,
|
||||
int child_process_id,
|
||||
content::FileDescriptorInfo* mappings) {
|
||||
if (v8_snapshot_fd_.get() == -1 && v8_natives_fd_.get() == -1) {
|
||||
base::FilePath v8_data_path;
|
||||
PathService::Get(gin::IsolateHolder::kV8SnapshotBasePathKey, &v8_data_path);
|
||||
DCHECK(!v8_data_path.empty());
|
||||
|
||||
int file_flags = base::File::FLAG_OPEN | base::File::FLAG_READ;
|
||||
base::FilePath v8_natives_data_path =
|
||||
v8_data_path.AppendASCII(gin::IsolateHolder::kNativesFileName);
|
||||
base::FilePath v8_snapshot_data_path =
|
||||
v8_data_path.AppendASCII(gin::IsolateHolder::kSnapshotFileName);
|
||||
base::File v8_natives_data_file(v8_natives_data_path, file_flags);
|
||||
base::File v8_snapshot_data_file(v8_snapshot_data_path, file_flags);
|
||||
DCHECK(v8_natives_data_file.IsValid());
|
||||
DCHECK(v8_snapshot_data_file.IsValid());
|
||||
v8_natives_fd_.reset(v8_natives_data_file.TakePlatformFile());
|
||||
v8_snapshot_fd_.reset(v8_snapshot_data_file.TakePlatformFile());
|
||||
}
|
||||
mappings->Share(kV8NativesDataDescriptor, v8_natives_fd_.get());
|
||||
mappings->Share(kV8SnapshotDataDescriptor, v8_snapshot_fd_.get());
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace brightray
|
||||
|
|
|
@ -46,8 +46,20 @@ class BrowserClient : public content::ContentBrowserClient {
|
|||
base::FilePath GetDefaultDownloadDirectory() override;
|
||||
content::DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
||||
void GetAdditionalMappedFilesForChildProcess(
|
||||
const base::CommandLine& command_line,
|
||||
int child_process_id,
|
||||
content::FileDescriptorInfo* mappings) override;
|
||||
#endif
|
||||
|
||||
BrowserMainParts* browser_main_parts_;
|
||||
|
||||
#if defined(OS_POSIX) && !defined(OS_MACOSX)
|
||||
base::ScopedFD v8_natives_fd_;
|
||||
base::ScopedFD v8_snapshot_fd_;
|
||||
#endif // OS_POSIX && !OS_MACOSX
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(BrowserClient);
|
||||
};
|
||||
|
||||
|
|
|
@ -50,17 +50,24 @@ const char kTargetTypeOther[] = "other";
|
|||
class TCPServerSocketFactory
|
||||
: public content::DevToolsHttpHandler::ServerSocketFactory {
|
||||
public:
|
||||
TCPServerSocketFactory(const std::string& address, int port, int backlog)
|
||||
: content::DevToolsHttpHandler::ServerSocketFactory(
|
||||
address, port, backlog) {}
|
||||
TCPServerSocketFactory(const std::string& address, int port)
|
||||
: address_(address), port_(port) {
|
||||
}
|
||||
|
||||
private:
|
||||
// content::DevToolsHttpHandler::ServerSocketFactory.
|
||||
scoped_ptr<net::ServerSocket> Create() const override {
|
||||
return scoped_ptr<net::ServerSocket>(
|
||||
new net::TCPServerSocket(NULL, net::NetLog::Source()));
|
||||
scoped_ptr<net::ServerSocket> CreateForHttpServer() override {
|
||||
scoped_ptr<net::ServerSocket> socket(
|
||||
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);
|
||||
};
|
||||
|
||||
|
@ -82,7 +89,7 @@ CreateSocketFactory() {
|
|||
}
|
||||
}
|
||||
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 {
|
||||
|
@ -152,8 +159,6 @@ class DevToolsDelegate : public content::DevToolsHttpHandlerDelegate {
|
|||
std::string GetDiscoveryPageHTML() override;
|
||||
bool BundlesFrontendResources() override;
|
||||
base::FilePath GetDebugFrontendDir() override;
|
||||
scoped_ptr<net::ServerSocket> CreateSocketForTethering(
|
||||
std::string* name) override;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(DevToolsDelegate);
|
||||
|
@ -178,11 +183,6 @@ base::FilePath DevToolsDelegate::GetDebugFrontendDir() {
|
|||
return base::FilePath();
|
||||
}
|
||||
|
||||
scoped_ptr<net::ServerSocket> DevToolsDelegate::CreateSocketForTethering(
|
||||
std::string* name) {
|
||||
return scoped_ptr<net::ServerSocket>();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// DevToolsManagerDelegate ---------------------------------------------------
|
||||
|
|
|
@ -324,6 +324,7 @@ void InspectableWebContentsImpl::AgentHostClosed(
|
|||
}
|
||||
|
||||
void InspectableWebContentsImpl::AboutToNavigateRenderFrame(
|
||||
content::RenderFrameHost* old_host,
|
||||
content::RenderFrameHost* new_host) {
|
||||
if (new_host->GetParent())
|
||||
return;
|
||||
|
|
|
@ -104,7 +104,8 @@ class InspectableWebContentsImpl :
|
|||
bool replaced) override;
|
||||
|
||||
// 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,
|
||||
const GURL& validated_url) override;
|
||||
void WebContentsDestroyed() override;
|
||||
|
|
|
@ -27,7 +27,14 @@ NotificationPresenter* PlatformNotificationServiceImpl::notification_presenter()
|
|||
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,
|
||||
const GURL& origin,
|
||||
int render_process_id) {
|
||||
|
@ -40,7 +47,6 @@ void PlatformNotificationServiceImpl::DisplayNotification(
|
|||
const SkBitmap& icon,
|
||||
const content::PlatformNotificationData& notification_data,
|
||||
scoped_ptr<content::DesktopNotificationDelegate> delegate,
|
||||
int render_process_id,
|
||||
base::Closure* cancel_callback) {
|
||||
auto presenter = notification_presenter();
|
||||
if (presenter)
|
||||
|
@ -49,11 +55,10 @@ void PlatformNotificationServiceImpl::DisplayNotification(
|
|||
|
||||
void PlatformNotificationServiceImpl::DisplayPersistentNotification(
|
||||
content::BrowserContext* browser_context,
|
||||
int64 service_worker_registration_id,
|
||||
int64_t service_worker_registration_id,
|
||||
const GURL& origin,
|
||||
const SkBitmap& icon,
|
||||
const content::PlatformNotificationData& notification_data,
|
||||
int render_process_id) {
|
||||
const content::PlatformNotificationData& notification_data) {
|
||||
}
|
||||
|
||||
void PlatformNotificationServiceImpl::ClosePersistentNotification(
|
||||
|
|
|
@ -28,26 +28,28 @@ class PlatformNotificationServiceImpl
|
|||
~PlatformNotificationServiceImpl() override;
|
||||
|
||||
// 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,
|
||||
const GURL& origin,
|
||||
int render_process_id) override;
|
||||
virtual void DisplayNotification(
|
||||
void DisplayNotification(
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& origin,
|
||||
const SkBitmap& icon,
|
||||
const content::PlatformNotificationData& notification_data,
|
||||
scoped_ptr<content::DesktopNotificationDelegate> delegate,
|
||||
int render_process_id,
|
||||
base::Closure* cancel_callback) override;
|
||||
virtual void DisplayPersistentNotification(
|
||||
void DisplayPersistentNotification(
|
||||
content::BrowserContext* browser_context,
|
||||
int64 service_worker_registration_id,
|
||||
int64_t service_worker_registration_id,
|
||||
const GURL& origin,
|
||||
const SkBitmap& icon,
|
||||
const content::PlatformNotificationData& notification_data,
|
||||
int render_process_id) override;
|
||||
virtual void ClosePersistentNotification(
|
||||
const content::PlatformNotificationData& notification_data) override;
|
||||
void ClosePersistentNotification(
|
||||
content::BrowserContext* browser_context,
|
||||
const std::string& persistent_notification_id) override;
|
||||
|
||||
|
|
|
@ -154,9 +154,9 @@ net::URLRequestContext* URLRequestContextGetter::GetURLRequestContext() {
|
|||
content::CookieStoreConfig::EPHEMERAL_SESSION_COOKIES,
|
||||
NULL, NULL);
|
||||
storage_->set_cookie_store(content::CreateCookieStore(cookie_config));
|
||||
storage_->set_channel_id_service(new net::ChannelIDService(
|
||||
new net::DefaultChannelIDStore(NULL),
|
||||
base::WorkerPool::GetTaskRunner(true)));
|
||||
storage_->set_channel_id_service(make_scoped_ptr(
|
||||
new net::ChannelIDService(new net::DefaultChannelIDStore(NULL),
|
||||
base::WorkerPool::GetTaskRunner(true))));
|
||||
storage_->set_http_user_agent_settings(new net::StaticHttpUserAgentSettings(
|
||||
"en-us,en", base::EmptyString()));
|
||||
|
||||
|
|
2
brightray/vendor/libchromiumcontent
vendored
2
brightray/vendor/libchromiumcontent
vendored
|
@ -1 +1 @@
|
|||
Subproject commit 6d2427e4f1170aa56e9dc1c4fd8922dea7e233c0
|
||||
Subproject commit d5c126e2d8fd181a94720c64b18196505b937041
|
Loading…
Reference in a new issue