Coding style changes
This commit is contained in:
parent
eaa4b71c24
commit
776e8afa2b
3 changed files with 13 additions and 11 deletions
|
@ -681,15 +681,17 @@ void Session::CreateInterruptedDownload(const mate::Dictionary& options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::AddPreload(const base::FilePath::StringType& preloadPath) {
|
void Session::AddPreload(const base::FilePath::StringType& preloadPath) {
|
||||||
g_preloads.push_back(preloadPath);
|
preloads_.push_back(preloadPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Session::RemovePreload(const base::FilePath::StringType& preloadPath) {
|
void Session::RemovePreload(const base::FilePath::StringType& preloadPath) {
|
||||||
g_preloads.erase(
|
preloads_.erase(
|
||||||
std::remove(g_preloads.begin(), g_preloads.end(), preloadPath),
|
std::remove(preloads_.begin(), preloads_.end(), preloadPath),
|
||||||
g_preloads.end());
|
preloads_.end());
|
||||||
}
|
}
|
||||||
std::vector<base::FilePath::StringType> Session::GetPreloads() {
|
|
||||||
return g_preloads;
|
std::vector<base::FilePath::StringType> Session::GetPreloads() const {
|
||||||
|
return preloads_;
|
||||||
}
|
}
|
||||||
|
|
||||||
v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
|
v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ class Session: public mate::TrackableObject<Session>,
|
||||||
void CreateInterruptedDownload(const mate::Dictionary& options);
|
void CreateInterruptedDownload(const mate::Dictionary& options);
|
||||||
void AddPreload(const base::FilePath::StringType& preloadPath);
|
void AddPreload(const base::FilePath::StringType& preloadPath);
|
||||||
void RemovePreload(const base::FilePath::StringType& preloadPath);
|
void RemovePreload(const base::FilePath::StringType& preloadPath);
|
||||||
std::vector<base::FilePath::StringType> GetPreloads();
|
std::vector<base::FilePath::StringType> GetPreloads() const;
|
||||||
v8::Local<v8::Value> Cookies(v8::Isolate* isolate);
|
v8::Local<v8::Value> Cookies(v8::Isolate* isolate);
|
||||||
v8::Local<v8::Value> Protocol(v8::Isolate* isolate);
|
v8::Local<v8::Value> Protocol(v8::Isolate* isolate);
|
||||||
v8::Local<v8::Value> WebRequest(v8::Isolate* isolate);
|
v8::Local<v8::Value> WebRequest(v8::Isolate* isolate);
|
||||||
|
@ -107,7 +107,7 @@ class Session: public mate::TrackableObject<Session>,
|
||||||
std::string devtools_network_emulation_client_id_;
|
std::string devtools_network_emulation_client_id_;
|
||||||
|
|
||||||
scoped_refptr<AtomBrowserContext> browser_context_;
|
scoped_refptr<AtomBrowserContext> browser_context_;
|
||||||
std::vector<base::FilePath::StringType> g_preloads;
|
std::vector<base::FilePath::StringType> preloads_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(Session);
|
DISALLOW_COPY_AND_ASSIGN(Session);
|
||||||
};
|
};
|
||||||
|
|
|
@ -141,10 +141,10 @@ void WebContentsPreferences::AppendExtraCommandLineSwitches(
|
||||||
|
|
||||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||||
mate::Handle<atom::api::WebContents> api_web_contents =
|
mate::Handle<atom::api::WebContents> api_web_contents =
|
||||||
atom::api::WebContents::CreateFrom(isolate, web_contents);
|
atom::api::WebContents::CreateFrom(isolate, web_contents);
|
||||||
auto session = atom::api::Session::CreateFrom(
|
auto session = atom::api::Session::CreateFrom(
|
||||||
isolate, api_web_contents.get()->GetBrowserContext());
|
isolate, api_web_contents.get()->GetBrowserContext());
|
||||||
for (auto preloadPath : session->GetPreloads()) {
|
for (const auto& preloadPath : session->GetPreloads()) {
|
||||||
if (base::FilePath(preloadPath).IsAbsolute())
|
if (base::FilePath(preloadPath).IsAbsolute())
|
||||||
command_line->AppendSwitchNative(switches::kSessionPreloadScript,
|
command_line->AppendSwitchNative(switches::kSessionPreloadScript,
|
||||||
preloadPath);
|
preloadPath);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue