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

Side by Side Diff: Source/bindings/core/dart/DartScriptDebugServer.h

Issue 1428333002: Don't remove things, especially isolates, from a map if they're not there (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: format the TODO better Created 5 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 T remove(int handle) 81 T remove(int handle)
82 { 82 {
83 T value = m_handleToValueMap.take(handle); 83 T value = m_handleToValueMap.take(handle);
84 m_valueToHandleMap.remove(value); 84 m_valueToHandleMap.remove(value);
85 return value; 85 return value;
86 } 86 }
87 87
88 int removeByValue(T value) 88 int removeByValue(T value)
89 { 89 {
90 int handle = m_valueToHandleMap.take(value); 90 int handle = m_valueToHandleMap.take(value);
91 m_handleToValueMap.remove(handle); 91 // TODO(alanknight): This is clearly wrong. We should never call this
92 // with an invalid value, but we are doing so sometimes in isolate
93 // shutdown. We need to track down the underlying cause, but this
94 // is a workaround.
95 if (handle != 0) {
96 m_handleToValueMap.remove(handle);
97 }
92 return handle; 98 return handle;
93 } 99 }
94 100
95 void copyValues(Vector<T>& values) 101 void copyValues(Vector<T>& values)
96 { 102 {
97 copyKeysToVector(m_valueToHandleMap, values); 103 copyKeysToVector(m_valueToHandleMap, values);
98 } 104 }
99 105
100 private: 106 private:
101 int m_lastHandle; 107 int m_lastHandle;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 PageScriptDebugServer::ClientMessageLoop* m_clientMessageLoop; 278 PageScriptDebugServer::ClientMessageLoop* m_clientMessageLoop;
273 279
274 DartInjectedScriptManager* m_injectedScriptManager; 280 DartInjectedScriptManager* m_injectedScriptManager;
275 281
276 int m_nextPageId; 282 int m_nextPageId;
277 }; 283 };
278 284
279 } 285 }
280 286
281 #endif // DartScriptDebugServer_h 287 #endif // DartScriptDebugServer_h
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698