Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: Source/bindings/v8/Dictionary.cpp

Issue 17063016: Remove leak of objects between isolated worlds on custom events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Large set of fixes from adamk and haraken. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ASSERT(m_isolate == v8::Isolate::GetCurrent()); 103 ASSERT(m_isolate == v8::Isolate::GetCurrent());
104 v8::Handle<v8::String> v8Key = v8String(key, m_isolate); 104 v8::Handle<v8::String> v8Key = v8String(key, m_isolate);
105 if (!options->Has(v8Key)) 105 if (!options->Has(v8Key))
106 return false; 106 return false;
107 value = options->Get(v8Key); 107 value = options->Get(v8Key);
108 if (value.IsEmpty()) 108 if (value.IsEmpty())
109 return false; 109 return false;
110 return true; 110 return true;
111 } 111 }
112 112
113 bool Dictionary::get(const String& key, v8::Local<v8::Value>& value) const
114 {
115 return getKey(key, value);
116 }
117
113 bool Dictionary::get(const String& key, bool& value) const 118 bool Dictionary::get(const String& key, bool& value) const
114 { 119 {
115 v8::Local<v8::Value> v8Value; 120 v8::Local<v8::Value> v8Value;
116 if (!getKey(key, v8Value)) 121 if (!getKey(key, v8Value))
117 return false; 122 return false;
118 123
119 v8::Local<v8::Boolean> v8Bool = v8Value->ToBoolean(); 124 v8::Local<v8::Boolean> v8Bool = v8Value->ToBoolean();
120 if (v8Bool.IsEmpty()) 125 if (v8Bool.IsEmpty())
121 return false; 126 return false;
122 value = v8Bool->Value(); 127 value = v8Bool->Value();
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 v8::Local<v8::String> key = properties->Get(i)->ToString(); 587 v8::Local<v8::String> key = properties->Get(i)->ToString();
583 if (!options->Has(key)) 588 if (!options->Has(key))
584 continue; 589 continue;
585 names.append(toWebCoreString(key)); 590 names.append(toWebCoreString(key));
586 } 591 }
587 592
588 return true; 593 return true;
589 } 594 }
590 595
591 } // namespace WebCore 596 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698