Infinite Linting

This commit is contained in:
Paul Betts 2015-10-20 15:00:10 -07:00
parent f759471e01
commit 4a7a09aae1
6 changed files with 14 additions and 10 deletions

View file

@ -276,11 +276,12 @@ bool App::MakeSingleInstance(v8::Local<v8::Function> callback) {
browser->InitializeSingleInstance(); browser->InitializeSingleInstance();
ProcessSingleton::NotificationCallback cb; ProcessSingleton::NotificationCallback cb;
mate::Converter<ProcessSingleton::NotificationCallback>::FromV8(isolate(), single_instance_callback_, &cb); mate::Converter<ProcessSingleton::NotificationCallback>::FromV8(
isolate(), single_instance_callback_, &cb);
browser->SetSingleInstanceCallback(cb); browser->SetSingleInstanceCallback(cb);
switch(browser->GetSingleInstanceResult()) { switch (browser->GetSingleInstanceResult()) {
case ProcessSingleton::NotifyResult::PROCESS_NONE: case ProcessSingleton::NotifyResult::PROCESS_NONE:
return false; return false;
case ProcessSingleton::NotifyResult::LOCK_ERROR: case ProcessSingleton::NotifyResult::LOCK_ERROR:

View file

@ -71,7 +71,7 @@ class App : public mate::EventEmitter,
void AllowNTLMCredentialsForAllDomains(bool should_allow); void AllowNTLMCredentialsForAllDomains(bool should_allow);
bool MakeSingleInstance(v8::Local<v8::Function> callback); bool MakeSingleInstance(v8::Local<v8::Function> callback);
std::string GetLocale(); std::string GetLocale();
v8::Local<v8::Value> DefaultSession(v8::Isolate* isolate); v8::Local<v8::Value> DefaultSession(v8::Isolate* isolate);

View file

@ -16,7 +16,7 @@ class AtomProcessSingleton {
AtomProcessSingleton( AtomProcessSingleton(
const base::FilePath& user_data_dir, const base::FilePath& user_data_dir,
const ProcessSingleton::NotificationCallback& notification_callback); const ProcessSingleton::NotificationCallback& notification_callback);
~AtomProcessSingleton(); ~AtomProcessSingleton();
// Notify another process, if available. Otherwise sets ourselves as the // Notify another process, if available. Otherwise sets ourselves as the

View file

@ -117,7 +117,7 @@ void Browser::WillFinishLaunching() {
void Browser::DidFinishLaunching() { void Browser::DidFinishLaunching() {
is_ready_ = true; is_ready_ = true;
process_singleton_->Unlock() ; process_singleton_->Unlock();
FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching()); FOR_EACH_OBSERVER(BrowserObserver, observers_, OnFinishLaunching());
} }
@ -174,7 +174,8 @@ ProcessSingleton::NotifyResult Browser::GetSingleInstanceResult() {
return process_notify_result_; return process_notify_result_;
} }
void Browser::SetSingleInstanceCallback(ProcessSingleton::NotificationCallback callback) { void Browser::SetSingleInstanceCallback(
ProcessSingleton::NotificationCallback callback) {
process_notify_callback_ = callback; process_notify_callback_ = callback;
process_notify_callback_set_ = true; process_notify_callback_set_ = true;
} }

View file

@ -68,7 +68,8 @@ class Browser : public WindowListObserver {
void InitializeSingleInstance(); void InitializeSingleInstance();
ProcessSingleton::NotifyResult GetSingleInstanceResult(); ProcessSingleton::NotifyResult GetSingleInstanceResult();
void SetSingleInstanceCallback(ProcessSingleton::NotificationCallback callback); void SetSingleInstanceCallback(
ProcessSingleton::NotificationCallback callback);
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Bounce the dock icon. // Bounce the dock icon.

View file

@ -16,13 +16,14 @@ template<>
struct Converter<base::CommandLine> { struct Converter<base::CommandLine> {
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
const base::CommandLine& val) { const base::CommandLine& val) {
return Converter<base::CommandLine::StringType>::ToV8(isolate, val.GetCommandLineString()); return Converter<base::CommandLine::StringType>::ToV8(
isolate, val.GetCommandLineString());
} }
static bool FromV8(v8::Isolate* isolate, static bool FromV8(v8::Isolate* isolate,
v8::Local<v8::Value> val, v8::Local<v8::Value> val,
base::CommandLine* out) { base::CommandLine* out) {
base::FilePath::StringType path; base::FilePath::StringType path;
if (Converter<base::FilePath::StringType>::FromV8(isolate, val, &path)) { if (Converter<base::FilePath::StringType>::FromV8(isolate, val, &path)) {
*out = base::CommandLine(base::FilePath(path)); *out = base::CommandLine(base::FilePath(path));
return true; return true;
@ -34,4 +35,4 @@ struct Converter<base::CommandLine> {
} // namespace mate } // namespace mate
#endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_FILE_PATH_CONVERTER_H_ #endif // ATOM_COMMON_NATIVE_MATE_CONVERTERS_COMMAND_LINE_CONVERTER_H_