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

Side by Side Diff: third_party/WebKit/Source/modules/webdatabase/Database.cpp

Issue 2375733003: Add missing null check in Database::getSecurityOrigin() (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash-expected.txt ('k') | 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) 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2013 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 890
891 std::unique_ptr<DatabaseTableNamesTask> task = DatabaseTableNamesTask::creat e(this, &event, result); 891 std::unique_ptr<DatabaseTableNamesTask> task = DatabaseTableNamesTask::creat e(this, &event, result);
892 getDatabaseContext()->databaseThread()->scheduleTask(std::move(task)); 892 getDatabaseContext()->databaseThread()->scheduleTask(std::move(task));
893 event.wait(); 893 event.wait();
894 894
895 return result; 895 return result;
896 } 896 }
897 897
898 SecurityOrigin* Database::getSecurityOrigin() const 898 SecurityOrigin* Database::getSecurityOrigin() const
899 { 899 {
900 if (!getExecutionContext())
901 return nullptr;
900 if (getExecutionContext()->isContextThread()) 902 if (getExecutionContext()->isContextThread())
901 return m_contextThreadSecurityOrigin.get(); 903 return m_contextThreadSecurityOrigin.get();
902 if (getDatabaseContext()->databaseThread()->isDatabaseThread()) 904 if (getDatabaseContext()->databaseThread()->isDatabaseThread())
903 return m_databaseThreadSecurityOrigin.get(); 905 return m_databaseThreadSecurityOrigin.get();
904 return 0; 906 return nullptr;
905 } 907 }
906 908
907 bool Database::opened() 909 bool Database::opened()
908 { 910 {
909 return static_cast<bool>(acquireLoad(&m_opened)); 911 return static_cast<bool>(acquireLoad(&m_opened));
910 } 912 }
911 913
912 } // namespace blink 914 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/websql/transaction-removed-context-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698