commit
6aec1e6949
145 changed files with 642 additions and 585 deletions
|
@ -230,8 +230,7 @@ void App::OnLogin(LoginHandler* login_handler) {
|
|||
}
|
||||
|
||||
void App::AllowCertificateError(
|
||||
int pid,
|
||||
int fid,
|
||||
content::WebContents* web_contents,
|
||||
int cert_error,
|
||||
const net::SSLInfo& ssl_info,
|
||||
const GURL& request_url,
|
||||
|
@ -241,9 +240,6 @@ void App::AllowCertificateError(
|
|||
bool expired_previous_decision,
|
||||
const base::Callback<void(bool)>& callback,
|
||||
content::CertificateRequestResultType* request) {
|
||||
auto rfh = content::RenderFrameHost::FromID(pid, fid);
|
||||
auto web_contents = content::WebContents::FromRenderFrameHost(rfh);
|
||||
|
||||
v8::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
bool prevent_default = Emit("certificate-error",
|
||||
|
|
|
@ -52,8 +52,7 @@ class App : public AtomBrowserClient::Delegate,
|
|||
|
||||
// content::ContentBrowserClient:
|
||||
void AllowCertificateError(
|
||||
int render_process_id,
|
||||
int render_frame_id,
|
||||
content::WebContents* web_contents,
|
||||
int cert_error,
|
||||
const net::SSLInfo& ssl_info,
|
||||
const GURL& request_url,
|
||||
|
|
|
@ -53,13 +53,7 @@ scoped_refptr<TracingController::TraceDataSink> GetTraceDataSink(
|
|||
|
||||
void StopRecording(const base::FilePath& path,
|
||||
const CompletionCallback& callback) {
|
||||
TracingController::GetInstance()->DisableRecording(
|
||||
GetTraceDataSink(path, callback));
|
||||
}
|
||||
|
||||
void CaptureMonitoringSnapshot(const base::FilePath& path,
|
||||
const CompletionCallback& callback) {
|
||||
TracingController::GetInstance()->CaptureMonitoringSnapshot(
|
||||
TracingController::GetInstance()->StopTracing(
|
||||
GetTraceDataSink(path, callback));
|
||||
}
|
||||
|
||||
|
@ -70,13 +64,8 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
|
|||
dict.SetMethod("getCategories", base::Bind(
|
||||
&TracingController::GetCategories, controller));
|
||||
dict.SetMethod("startRecording", base::Bind(
|
||||
&TracingController::EnableRecording, controller));
|
||||
&TracingController::StartTracing, controller));
|
||||
dict.SetMethod("stopRecording", &StopRecording);
|
||||
dict.SetMethod("startMonitoring", base::Bind(
|
||||
&TracingController::EnableMonitoring, controller));
|
||||
dict.SetMethod("stopMonitoring", base::Bind(
|
||||
&TracingController::DisableMonitoring, controller));
|
||||
dict.SetMethod("captureMonitoringSnapshot", &CaptureMonitoringSnapshot);
|
||||
dict.SetMethod("getTraceBufferUsage", base::Bind(
|
||||
&TracingController::GetTraceBufferUsage, controller));
|
||||
dict.SetMethod("setWatchEvent", base::Bind(
|
||||
|
|
|
@ -180,7 +180,8 @@ void SetCookieOnIO(scoped_refptr<net::URLRequestContextGetter> getter,
|
|||
|
||||
GetCookieStore(getter)->GetCookieMonster()->SetCookieWithDetailsAsync(
|
||||
GURL(url), name, value, domain, path, expiration_time, secure, http_only,
|
||||
false, net::COOKIE_PRIORITY_DEFAULT, base::Bind(OnSetCookie, callback));
|
||||
false, false, false, net::COOKIE_PRIORITY_DEFAULT,
|
||||
base::Bind(OnSetCookie, callback));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "atom/browser/api/atom_api_desktop_capturer.h"
|
||||
|
||||
#include "atom/common/api/atom_api_native_image.h"
|
||||
#include "atom/common/node_includes.h"
|
||||
#include "atom/common/native_mate_converters/gfx_converter.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/media/desktop_media_list.h"
|
||||
|
@ -14,6 +13,8 @@
|
|||
#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h"
|
||||
#include "third_party/webrtc/modules/desktop_capture/window_capturer.h"
|
||||
|
||||
#include "atom/common/node_includes.h"
|
||||
|
||||
namespace mate {
|
||||
|
||||
template<>
|
||||
|
@ -63,8 +64,8 @@ void DesktopCapturer::StartHandling(bool capture_window,
|
|||
capture_screen ? webrtc::ScreenCapturer::Create(options) : nullptr);
|
||||
scoped_ptr<webrtc::WindowCapturer> window_capturer(
|
||||
capture_window ? webrtc::WindowCapturer::Create(options) : nullptr);
|
||||
media_list_.reset(new NativeDesktopMediaList(screen_capturer.Pass(),
|
||||
window_capturer.Pass()));
|
||||
media_list_.reset(new NativeDesktopMediaList(
|
||||
std::move(screen_capturer), std::move(window_capturer)));
|
||||
|
||||
media_list_->SetThumbnailSize(thumbnail_size);
|
||||
media_list_->StartUpdating(this);
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace {
|
|||
using WrapDownloadItemCallback = base::Callback<void(v8::Local<v8::Value>)>;
|
||||
WrapDownloadItemCallback g_wrap_download_item;
|
||||
|
||||
std::map<uint32, linked_ptr<v8::Global<v8::Value>>> g_download_item_objects;
|
||||
std::map<uint32_t, linked_ptr<v8::Global<v8::Value>>> g_download_item_objects;
|
||||
|
||||
} // namespace
|
||||
|
||||
|
@ -106,11 +106,11 @@ void DownloadItem::Cancel() {
|
|||
download_item_->Remove();
|
||||
}
|
||||
|
||||
int64 DownloadItem::GetReceivedBytes() const {
|
||||
int64_t DownloadItem::GetReceivedBytes() const {
|
||||
return download_item_->GetReceivedBytes();
|
||||
}
|
||||
|
||||
int64 DownloadItem::GetTotalBytes() const {
|
||||
int64_t DownloadItem::GetTotalBytes() const {
|
||||
return download_item_->GetTotalBytes();
|
||||
}
|
||||
|
||||
|
|
|
@ -30,8 +30,8 @@ class DownloadItem : public mate::TrackableObject<DownloadItem>,
|
|||
void Pause();
|
||||
void Resume();
|
||||
void Cancel();
|
||||
int64 GetReceivedBytes() const;
|
||||
int64 GetTotalBytes() const;
|
||||
int64_t GetReceivedBytes() const;
|
||||
int64_t GetTotalBytes() const;
|
||||
std::string GetMimeType() const;
|
||||
bool HasUserGesture() const;
|
||||
std::string GetFilename() const;
|
||||
|
|
|
@ -117,7 +117,7 @@ class Protocol : public mate::Wrappable {
|
|||
scoped_ptr<CustomProtocolHandler<RequestJob>> protocol_handler(
|
||||
new CustomProtocolHandler<RequestJob>(
|
||||
isolate(), request_context_getter_, handler));
|
||||
if (job_factory_->SetProtocolHandler(scheme, protocol_handler.Pass()))
|
||||
if (job_factory_->SetProtocolHandler(scheme, std::move(protocol_handler)))
|
||||
return PROTOCOL_OK;
|
||||
else
|
||||
return PROTOCOL_FAIL;
|
||||
|
@ -161,7 +161,7 @@ class Protocol : public mate::Wrappable {
|
|||
isolate(), request_context_getter_, handler));
|
||||
original_protocols_.set(
|
||||
scheme,
|
||||
job_factory_->ReplaceProtocol(scheme, protocol_handler.Pass()));
|
||||
job_factory_->ReplaceProtocol(scheme, std::move(protocol_handler)));
|
||||
return PROTOCOL_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,12 +49,12 @@ namespace {
|
|||
|
||||
struct ClearStorageDataOptions {
|
||||
GURL origin;
|
||||
uint32 storage_types = StoragePartition::REMOVE_DATA_MASK_ALL;
|
||||
uint32 quota_types = StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL;
|
||||
uint32_t storage_types = StoragePartition::REMOVE_DATA_MASK_ALL;
|
||||
uint32_t quota_types = StoragePartition::QUOTA_MANAGED_STORAGE_MASK_ALL;
|
||||
};
|
||||
|
||||
uint32 GetStorageMask(const std::vector<std::string>& storage_types) {
|
||||
uint32 storage_mask = 0;
|
||||
uint32_t GetStorageMask(const std::vector<std::string>& storage_types) {
|
||||
uint32_t storage_mask = 0;
|
||||
for (const auto& it : storage_types) {
|
||||
auto type = base::ToLowerASCII(it);
|
||||
if (type == "appcache")
|
||||
|
@ -77,8 +77,8 @@ uint32 GetStorageMask(const std::vector<std::string>& storage_types) {
|
|||
return storage_mask;
|
||||
}
|
||||
|
||||
uint32 GetQuotaMask(const std::vector<std::string>& quota_types) {
|
||||
uint32 quota_mask = 0;
|
||||
uint32_t GetQuotaMask(const std::vector<std::string>& quota_types) {
|
||||
uint32_t quota_mask = 0;
|
||||
for (const auto& it : quota_types) {
|
||||
auto type = base::ToLowerASCII(it);
|
||||
if (type == "temporary")
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
#include "content/public/browser/resource_request_details.h"
|
||||
#include "content/public/browser/service_worker_context.h"
|
||||
|
@ -150,7 +151,7 @@ struct Converter<net::HttpResponseHeaders*> {
|
|||
} else {
|
||||
scoped_ptr<base::ListValue> values(new base::ListValue());
|
||||
values->AppendString(value);
|
||||
response_headers.Set(key, values.Pass());
|
||||
response_headers.Set(key, std::move(values));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -303,9 +304,9 @@ WebContents::~WebContents() {
|
|||
}
|
||||
|
||||
bool WebContents::AddMessageToConsole(content::WebContents* source,
|
||||
int32 level,
|
||||
int32_t level,
|
||||
const base::string16& message,
|
||||
int32 line_no,
|
||||
int32_t line_no,
|
||||
const base::string16& source_id) {
|
||||
if (type_ == BROWSER_WINDOW) {
|
||||
return false;
|
||||
|
@ -317,8 +318,9 @@ bool WebContents::AddMessageToConsole(content::WebContents* source,
|
|||
|
||||
bool WebContents::ShouldCreateWebContents(
|
||||
content::WebContents* web_contents,
|
||||
int route_id,
|
||||
int main_frame_route_id,
|
||||
int32_t route_id,
|
||||
int32_t main_frame_route_id,
|
||||
int32_t main_frame_widget_route_id,
|
||||
WindowContainerType window_container_type,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
|
@ -509,11 +511,11 @@ void WebContents::PluginCrashed(const base::FilePath& plugin_path,
|
|||
Emit("plugin-crashed", info.name, info.version);
|
||||
}
|
||||
|
||||
void WebContents::MediaStartedPlaying() {
|
||||
void WebContents::MediaStartedPlaying(const MediaPlayerId& id) {
|
||||
Emit("media-started-playing");
|
||||
}
|
||||
|
||||
void WebContents::MediaPaused() {
|
||||
void WebContents::MediaStoppedPlaying(const MediaPlayerId& id) {
|
||||
Emit("media-paused");
|
||||
}
|
||||
|
||||
|
@ -998,8 +1000,8 @@ void WebContents::ReplaceMisspelling(const base::string16& word) {
|
|||
web_contents()->ReplaceMisspelling(word);
|
||||
}
|
||||
|
||||
uint32 WebContents::FindInPage(mate::Arguments* args) {
|
||||
uint32 request_id = GetNextRequestId();
|
||||
uint32_t WebContents::FindInPage(mate::Arguments* args) {
|
||||
uint32_t request_id = GetNextRequestId();
|
||||
base::string16 search_text;
|
||||
blink::WebFindOptions options;
|
||||
if (!args->GetNext(&search_text) || search_text.empty()) {
|
||||
|
@ -1070,7 +1072,7 @@ void WebContents::BeginFrameSubscription(
|
|||
if (view) {
|
||||
scoped_ptr<FrameSubscriber> frame_subscriber(new FrameSubscriber(
|
||||
isolate(), view, callback));
|
||||
view->BeginFrameSubscription(frame_subscriber.Pass());
|
||||
view->BeginFrameSubscription(std::move(frame_subscriber));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
void Unselect();
|
||||
void Replace(const base::string16& word);
|
||||
void ReplaceMisspelling(const base::string16& word);
|
||||
uint32 FindInPage(mate::Arguments* args);
|
||||
uint32_t FindInPage(mate::Arguments* args);
|
||||
void StopFindInPage(content::StopFindAction action);
|
||||
|
||||
// Focus.
|
||||
|
@ -162,14 +162,15 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
|
||||
// content::WebContentsDelegate:
|
||||
bool AddMessageToConsole(content::WebContents* source,
|
||||
int32 level,
|
||||
int32_t level,
|
||||
const base::string16& message,
|
||||
int32 line_no,
|
||||
int32_t line_no,
|
||||
const base::string16& source_id) override;
|
||||
bool ShouldCreateWebContents(
|
||||
content::WebContents* web_contents,
|
||||
int route_id,
|
||||
int main_frame_route_id,
|
||||
int32_t route_id,
|
||||
int32_t main_frame_route_id,
|
||||
int32_t main_frame_widget_route_id,
|
||||
WindowContainerType window_container_type,
|
||||
const std::string& frame_name,
|
||||
const GURL& target_url,
|
||||
|
@ -252,8 +253,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
const std::vector<content::FaviconURL>& urls) override;
|
||||
void PluginCrashed(const base::FilePath& plugin_path,
|
||||
base::ProcessId plugin_pid) override;
|
||||
void MediaStartedPlaying() override;
|
||||
void MediaPaused() override;
|
||||
void MediaStartedPlaying(const MediaPlayerId& id) override;
|
||||
void MediaStoppedPlaying(const MediaPlayerId& id) override;
|
||||
void DidChangeThemeColor(SkColor theme_color) override;
|
||||
|
||||
// brightray::InspectableWebContentsViewDelegate:
|
||||
|
@ -270,7 +271,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
|
||||
AtomBrowserContext* GetBrowserContext() const;
|
||||
|
||||
uint32 GetNextRequestId() {
|
||||
uint32_t GetNextRequestId() {
|
||||
return ++request_id_;
|
||||
}
|
||||
|
||||
|
@ -299,7 +300,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
Type type_;
|
||||
|
||||
// Request id used for findInPage request.
|
||||
uint32 request_id_;
|
||||
uint32_t request_id_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(WebContents);
|
||||
};
|
||||
|
|
|
@ -54,7 +54,7 @@ void FrameSubscriber::OnFrameDelivered(const FrameCaptureCallback& callback,
|
|||
return;
|
||||
|
||||
bitmap.copyPixelsTo(
|
||||
reinterpret_cast<uint8*>(node::Buffer::Data(buffer.ToLocalChecked())),
|
||||
reinterpret_cast<uint8_t*>(node::Buffer::Data(buffer.ToLocalChecked())),
|
||||
rgb_arr_size);
|
||||
|
||||
callback_.Run(buffer.ToLocalChecked());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue