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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp

Issue 2054643003: Remove duplication of encoded image data (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring Created 4 years, 5 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) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 handleResponse(identifier, response, nullptr); 954 handleResponse(identifier, response, nullptr);
955 955
956 // handleResponse() may detect an error. In such a case (check |m_client| 956 // handleResponse() may detect an error. In such a case (check |m_client|
957 // as it gets reset by clear() call), skip the rest. 957 // as it gets reset by clear() call), skip the rest.
958 // 958 //
959 // |this| is alive here since loadResourceSynchronously() keeps it alive 959 // |this| is alive here since loadResourceSynchronously() keeps it alive
960 // until the end of the function. 960 // until the end of the function.
961 if (!m_client) 961 if (!m_client)
962 return; 962 return;
963 963
964 SharedBuffer* data = resource->resourceBuffer(); 964 RefPtr<SharedBuffer> data = resource->resourceBuffer();
965 if (data) 965 if (data)
966 handleReceivedData(data->data(), data->size()); 966 handleReceivedData(data->data(), data->size());
967 967
968 // The client may cancel this loader in handleReceivedData(). In such a 968 // The client may cancel this loader in handleReceivedData(). In such a
969 // case, skip the rest. 969 // case, skip the rest.
970 if (!m_client) 970 if (!m_client)
971 return; 971 return;
972 972
973 handleSuccessfulFinish(identifier, 0.0); 973 handleSuccessfulFinish(identifier, 0.0);
974 } 974 }
(...skipping 18 matching lines...) Expand all
993 return m_securityOrigin ? m_securityOrigin.get() : document().getSecurityOri gin(); 993 return m_securityOrigin ? m_securityOrigin.get() : document().getSecurityOri gin();
994 } 994 }
995 995
996 Document& DocumentThreadableLoader::document() const 996 Document& DocumentThreadableLoader::document() const
997 { 997 {
998 ASSERT(m_document); 998 ASSERT(m_document);
999 return *m_document; 999 return *m_document;
1000 } 1000 }
1001 1001
1002 } // namespace blink 1002 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698